]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
Fix a case where _get_config_value_for_remote could return None mistakenly 30/head
authorZack Cerza <zack@cerza.org>
Tue, 13 Aug 2013 18:30:22 +0000 (13:30 -0500)
committerZack Cerza <zack@cerza.org>
Tue, 13 Aug 2013 18:30:22 +0000 (13:30 -0500)
teuthology/task/install.py

index 106017cc01e131535390e61fbdab4613ce471c0f..3964951ad790289edc721ec3578c1a8265d50c35 100644 (file)
@@ -71,14 +71,16 @@ def _run_and_log_error_if_fails(remote, args):
 def _get_config_value_for_remote(ctx, remote, config, key):
     # This function was written to figure out which branch should be used for a
     # given remote. 'all' overrides any applicable roles.
-    if 'all' in config.keys():
-        return config['all'].get(key, None)
-    else:
-        roles = ctx.cluster.remotes[remote]
+
+    roles = ctx.cluster.remotes[remote]
+    if 'all' in config:
+        return config['all'][key]
+    elif roles:
         for role in roles:
             if role in config and key in config[role]:
                 return config[role][key]
-    return None
+    if key in config:
+        return config[key]
 
 
 def _get_baseurlinfo_and_dist(ctx, remote, config):
@@ -137,6 +139,7 @@ def _get_baseurlinfo_and_dist(ctx, remote, config):
         uri = 'sha1/' + sha1
     else:
         # FIXME: Should master be the default?
+        log.debug("defaulting to master branch")
         uri = 'ref/master'
     retval['uri'] = uri