From 43cb822bf48a74700d6b4c99c45f92a86d00e8ad Mon Sep 17 00:00:00 2001 From: Dan Callaghan Date: Aug 30 2017 13:37:57 +0000 Subject: beakerrepos.py: pass --name explicitly The current nightly composes identify themselves as just "Fedora Rawhide" in the .treeinfo file, rather than distinguished by date as in "Fedora-Rawhide-20170829.n.0". This means when they are imported into Beaker they will all be considered as the same tree, even though they are different snapshots. As a workaround, pass --name when invoking beaker-import to make the trees show up with their proper name. This means we can't use 'location' as a fallback for 'compose_id' anymore because the 'location' URL isn't usable as a distro tree name in Beaker. But that should be okay since all recent compose messages have a proper value for the 'compose_id' key. --- diff --git a/beakerrepos.py b/beakerrepos.py index 6e5ad98..fbe56eb 100644 --- a/beakerrepos.py +++ b/beakerrepos.py @@ -28,8 +28,8 @@ class BeakerRepoUpdater(fedmsg.consumers.FedmsgConsumer): logfnc = getattr(self.log, level) logfnc("%s: %s", self.__class__.__name__, message) - def beaker_import(self, url): - subprocess.check_output(['beaker-import',url]) + def beaker_import(self, name, url): + subprocess.check_output(['beaker-import', '--name', name, url]) def consume(self, message): """Consume incoming message.""" @@ -37,7 +37,7 @@ class BeakerRepoUpdater(fedmsg.consumers.FedmsgConsumer): status = msg['msg']['status'] location = msg['msg']['location'] - compstr = msg['msg'].get('compose_id', location) + compstr = msg['msg']['compose_id'] if 'FINISHED' in status and location: # We have a complete pungi4 compose @@ -47,7 +47,7 @@ class BeakerRepoUpdater(fedmsg.consumers.FedmsgConsumer): self._log('info', "Importing {0}/{1}/{2}/os".format(compstr, product, arch)) if DO_IMPORT: url = "{0}/{1}/{2}/os".format(location,product,arch) - self.beaker_import(url) + self.beaker_import(compstr, url) self._log('debug', "Finished") return