From 344b7434342714d8d745d1cb4d86d4dc60b2d727 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Tue, 20 Sep 2016 18:19:24 -0700 Subject: [PATCH] Revert "Set ctx.cluster even when a job has no roles" This reverts commit ffd14be3bd79baec5d9cafd8972d592085e0e099. --- teuthology/run.py | 9 ++++----- teuthology/task/internal.py | 11 ++--------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/teuthology/run.py b/teuthology/run.py index 22cb1bc7fa..e1f79a1270 100644 --- a/teuthology/run.py +++ b/teuthology/run.py @@ -184,14 +184,13 @@ def get_initial_tasks(lock, config, machine_type): init_tasks.append({'internal.lock_machines': ( len(config['roles']), machine_type)}) - init_tasks.extend([ - {'internal.save_config': None}, - {'internal.check_lock': None}, - {'internal.add_remotes': None}, - ]) + + init_tasks.append({'internal.save_config': None}) if 'roles' in config: init_tasks.extend([ + {'internal.check_lock': None}, + {'internal.add_remotes': None}, {'console_log': None}, {'internal.connect': None}, {'internal.push_inventory': None}, diff --git a/teuthology/task/internal.py b/teuthology/task/internal.py index 7849fac4e4..742f6fd078 100644 --- a/teuthology/task/internal.py +++ b/teuthology/task/internal.py @@ -213,11 +213,7 @@ def check_lock(ctx, config, check_up=True): """ Check lock status of remote machines. """ - if ( - not teuth_config.lock_server or - ctx.config.get('check-locks') is False or - 'roles' not in ctx.config - ): + if not teuth_config.lock_server or ctx.config.get('check-locks') is False: log.info('Lock checking disabled.') return log.info('Checking locks...') @@ -312,10 +308,6 @@ def add_remotes(ctx, config): """ Create a ctx.cluster object populated with remotes mapped to roles """ - ctx.cluster = cluster.Cluster() - # Allow jobs to run without using nodes, for self-testing - if 'roles' not in ctx.config: - return remotes = [] machs = [] for name in ctx.config['targets'].iterkeys(): @@ -329,6 +321,7 @@ def add_remotes(ctx, config): pass rem = remote.Remote(name=t, host_key=key, keep_alive=True) remotes.append(rem) + ctx.cluster = cluster.Cluster() if 'roles' in ctx.config: for rem, roles in zip(remotes, ctx.config['roles']): assert all(isinstance(role, str) for role in roles), \ -- 2.39.5