]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Initialize BASE before using it.
authorJosh Durgin <josh.durgin@dreamhost.com>
Fri, 10 Jun 2011 18:12:34 +0000 (11:12 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Fri, 10 Jun 2011 18:12:49 +0000 (11:12 -0700)
teuthology/misc.py

index e68b3a0e606e172deb99aaccd8cae57c379f79e2..6986993a110a67973bcfc410281d2a308e14f56e 100644 (file)
@@ -10,6 +10,18 @@ import urlparse
 log = logging.getLogger(__name__)
 
 def get_ceph_binary_url(branch=None, tag=None, sha1=None, flavor=None):
+    if flavor is None:
+        flavor = ''
+    else:
+        # TODO hardcoding amd64 here for simplicity; clients will try
+        # to fetch the tarball matching their arch, non-x86_64 just
+        # won't find anything and the test will fail. trying to
+        # support cross-arch clusters is messy because nothing
+        # guarantees the same sha1 of "master" has been built for all
+        # of them. hoping for yagni.
+        flavor = '-{flavor}-amd64'.format(flavor=flavor)
+    BASE = 'http://ceph.newdream.net/gitbuilder{flavor}/output/'.format(flavor=flavor)
+
     if sha1 is not None:
         assert branch is None, "cannot set both sha1 and branch"
         assert tag is None, "cannot set both sha1 and tag"
@@ -30,18 +42,6 @@ def get_ceph_binary_url(branch=None, tag=None, sha1=None, flavor=None):
         sha1 = sha1_fp.read().rstrip('\n')
         sha1_fp.close()
 
-    if flavor is None:
-        flavor = ''
-    else:
-        # TODO hardcoding amd64 here for simplicity; clients will try
-        # to fetch the tarball matching their arch, non-x86_64 just
-        # won't find anything and the test will fail. trying to
-        # support cross-arch clusters is messy because nothing
-        # guarantees the same sha1 of "master" has been built for all
-        # of them. hoping for yagni.
-        flavor = '-{flavor}-amd64'.format(flavor=flavor)
-    BASE = 'http://ceph.newdream.net/gitbuilder{flavor}/output/'.format(flavor=flavor)
-
     log.debug('Using ceph sha1 %s', sha1)
     bindir_url = urlparse.urljoin(BASE, 'sha1/{sha1}/'.format(sha1=sha1))
     return (sha1, bindir_url)