]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
task/install: define "project" before using it
authorKefu Chai <kchai@redhat.com>
Tue, 11 Dec 2018 09:31:08 +0000 (17:31 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 Dec 2018 12:33:53 +0000 (20:33 +0800)
no need to define `project` at the beginning of install(), we can
just use `config.get('project', 'ceph')`. better readability this way,
as we will reference `ceph` in the same expression.

Signed-off-by: Kefu Chai <kchai@redhat.com>
teuthology/task/install/__init__.py

index 8386a6bea7594819066edb54b2e8cd9212b3860e..43b06c7b9be57eade9449bf56d88ae49c10c25db 100644 (file)
@@ -227,8 +227,6 @@ def install(ctx, config):
     :param config: the config dict
     """
 
-    project = config.get('project', 'ceph')
-
     package_list = get_package_list(ctx, config)
     debs = package_list['deb']
     rpms = package_list['rpm']
@@ -261,7 +259,7 @@ def install(ctx, config):
     finally:
         remove_packages(ctx, config, package_list)
         remove_sources(ctx, config)
-        if project == 'ceph':
+        if config.get('project', 'ceph') == 'ceph':
             purge_data(ctx)