]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
GitbuilderProject: if multiple ref-selectors present, warn
authorDan Mick <dan.mick@redhat.com>
Wed, 29 Jun 2016 23:47:41 +0000 (16:47 -0700)
committerDan Mick <dan.mick@redhat.com>
Thu, 30 Jun 2016 18:24:58 +0000 (11:24 -0700)
...about which one is actually being used

Signed-off-by: Dan Mick <dan.mick@redhat.com>
teuthology/packaging.py

index f4afd54dcd9e0a07a9e3555db79a5f46749afec8..defbec31a82dcb0a0cca4f4955efe451ff9b41a8 100644 (file)
@@ -651,14 +651,25 @@ class GitbuilderProject(object):
             branch = self.branch
             sha1 = self.sha1
 
+        def warn(attrname):
+            if len([b for b in ref, tag, branch, sha1]) > 1:
+                log.warning(
+                    'More than one of ref, tag, branch, or sha1 supplied; using %s',
+                     attrname
+                )
+
         if ref:
             uri = 'ref'/ + ref
+            warn('ref')
         elif tag:
             uri = 'ref/' + tag
+            warn('tag')
         elif branch:
             uri = 'ref/' + branch
+            warn('branch')
         elif sha1:
             uri = 'sha1/' + sha1
+            warn('sha1')
         else:
             log.warning("defaulting to master branch")
             uri = getattr(self, 'ref', 'ref/master')