#1 beakerrepos.py: pass --name explicitly
Merged 6 years ago by dcallagh. Opened 6 years ago by dcallagh.
fedora-qa/ dcallagh/beaker-tools import-name  into  master

beakerrepos.py: pass --name explicitly
Dan Callaghan • 6 years ago  
file modified
+4 -4
@@ -28,8 +28,8 @@ 

          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 @@ 

  

          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 @@ 

                      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

  

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.

Why the merge commit? Otherwise, it looks good to me

Hmm not sure what you mean about merge commit. There is only one commit in this PR and it's not a merge. Unless I have done something weird...?

Tim means you should rebase it on top of the current master head. Otherwise it can only be merged with a merge commit (not a fast forward merge).

Dan, you have commit rights now. Feel free to push after rebase, thanks. You can include Merges: #1 in the commit description to have this automatically closed with a link.

rebased

6 years ago

Pull-Request has been merged by dcallagh

6 years ago

@tflink can you please try turning on this new version and we'll see how it goes with the latest composes?

Metadata