buildpackages_index = None
buildpackages_prep_index = None
for task in ctx.config['tasks']:
- if task.keys()[0] == 'install':
+ t = list(task)[0]
+ if t == 'install':
install_index = index
- if task.keys()[0] == 'buildpackages':
+ if t == 'buildpackages':
buildpackages_index = index
- if task.keys()[0] == 'internal.buildpackages_prep':
+ if t == 'internal.buildpackages_prep':
buildpackages_prep_index = index
index += 1
if (buildpackages_index is not None and
end=DEFAULT,
):
with self.klass(self.ctx, self.task_config) as task:
- task_hosts = task.cluster.remotes.keys()
+ task_hosts = list(task.cluster.remotes)
assert len(task_hosts) == 2
assert sorted(host.shortname for host in task_hosts) == \
['remote1', 'remote2']
end=DEFAULT,
):
with self.klass(self.ctx, self.task_config) as task:
- task_hosts = task.cluster.remotes.keys()
+ task_hosts = list(task.cluster.remotes)
assert len(task_hosts) == 1
assert task_hosts[0].shortname == 'remote1'
end=DEFAULT,
):
with self.klass(self.ctx, self.task_config) as task:
- task_hosts = task.cluster.remotes.keys()
+ task_hosts = list(task.cluster.remotes)
assert len(task_hosts) == 2
hostnames = [host.shortname for host in task_hosts]
assert sorted(hostnames) == ['remote1', 'remote3']
end=DEFAULT,
):
with self.klass(self.ctx, self.task_config) as task:
- task_hosts = task.cluster.remotes.keys()
+ task_hosts = list(task.cluster.remotes)
assert len(task_hosts) == 2
hostnames = [host.hostname for host in task_hosts]
assert sorted(hostnames) == ['remote1.example.com',
end=DEFAULT,
):
with self.klass(self.ctx, self.task_config) as task:
- task_hosts = task.cluster.remotes.keys()
+ task_hosts = list(task.cluster.remotes)
assert len(task_hosts) == 2
hostnames = [host.hostname for host in task_hosts]
assert sorted(hostnames) == ['remote1.example.com',