mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-04-04 19:28:49 +08:00
Don't trigger init handler when importing a local build and mark the build as done after import
This commit is contained in:
@@ -254,7 +254,7 @@ class ModuleBuild(MBSBase):
|
||||
|
||||
@classmethod
|
||||
def create(cls, session, conf, name, stream, version, modulemd, scmurl, username,
|
||||
copr_owner=None, copr_project=None, rebuild_strategy=None):
|
||||
copr_owner=None, copr_project=None, rebuild_strategy=None, publish_msg=True):
|
||||
now = datetime.utcnow()
|
||||
module = cls(
|
||||
name=name,
|
||||
@@ -276,12 +276,13 @@ class ModuleBuild(MBSBase):
|
||||
module.module_builds_trace.append(mbt)
|
||||
session.add(module)
|
||||
session.commit()
|
||||
module_build_service.messaging.publish(
|
||||
service='mbs',
|
||||
topic='module.state.change',
|
||||
msg=module.extended_json(), # Note the state is "init" here...
|
||||
conf=conf,
|
||||
)
|
||||
if publish_msg:
|
||||
module_build_service.messaging.publish(
|
||||
service='mbs',
|
||||
topic='module.state.change',
|
||||
msg=module.extended_json(), # Note the state is "init" here...
|
||||
conf=conf,
|
||||
)
|
||||
return module
|
||||
|
||||
def transition(self, conf, state, state_reason=None):
|
||||
|
||||
@@ -703,8 +703,10 @@ def load_local_builds(local_build_nsvs, session=None):
|
||||
version=str(mmd.version),
|
||||
modulemd=mmd.dumps(),
|
||||
scmurl="",
|
||||
username="mbs")
|
||||
username="mbs",
|
||||
publish_msg=False)
|
||||
module.koji_tag = path
|
||||
module.state = models.BUILD_STATES['done']
|
||||
session.commit()
|
||||
|
||||
if (found_build[0] != module.name or found_build[1] != module.stream or
|
||||
|
||||
Reference in New Issue
Block a user