From: Sage Weil Date: Wed, 2 Oct 2013 03:57:53 +0000 (-0700) Subject: nuke: s/run_name/name/ X-Git-Tag: 1.1.0~1842 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e17928d588e7e85c6b103ec0ec5864153af0cf50;p=teuthology.git nuke: s/run_name/name/ This matches an existing argument (with the same meaning) and avoids an error like 2013-10-01T17:20:35.395 CRITICAL:root: File "/var/lib/teuthworker/teuthology-master/virtualenv/bin/teuthology", line 9, in load_entry_point('teuthology==0.0.1', 'console_scripts', 'teuthology')() File "/home/teuthworker/teuthology-master/teuthology/run.py", line 235, in main nuke(ctx, log, ctx.lock) File "/home/teuthworker/teuthology-master/teuthology/nuke.py", line 391, in nuke if ctx.run_name: 2013-10-01T17:20:35.395 CRITICAL:root:AttributeError: 'Namespace' object has no attribute 'run_name' Signed-off-by: Sage Weil --- diff --git a/teuthology/nuke.py b/teuthology/nuke.py index 05d11248..59ddb213 100644 --- a/teuthology/nuke.py +++ b/teuthology/nuke.py @@ -358,7 +358,7 @@ def main(): ctx.owner = info.get('owner') if not ctx.owner: ctx.owner = open(ctx.archive + '/owner').read().rstrip('\n') - ctx.run_name = info.get('name') + ctx.name = info.get('name') from teuthology.misc import read_config read_config(ctx) @@ -388,14 +388,14 @@ def nuke(ctx, log, should_unlock, sync_clocks=True, reboot_all=True, from teuthology.lock import list_locks total_unnuked = {} targets = dict(ctx.config['targets']) - if ctx.run_name: + if ctx.name: log.info('Checking targets against current locks') locks = list_locks(ctx) #Remove targets who's description doesn't match archive name. for lock in locks: for target in targets: if target == lock['name']: - if ctx.run_name not in lock['description']: + if ctx.name not in lock['description']: del ctx.config['targets'][lock['name']] log.info('Not nuking %s because description doesn\'t match', lock['name']) with parallel() as p: