Skip to content

Commit

Permalink
Merge "Using correct host_string as argument to get_hostname to get t…
Browse files Browse the repository at this point in the history
…he host name from the testbed.py, during reimage and other operations with hostname. Closes-Bug: 1543857"
  • Loading branch information
Zuul authored and opencontrail-ci-admin committed Feb 17, 2016
2 parents 5e88d3a + 9ca7ebe commit dda3988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fabfile/tasks/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def all_reimage(build_param="@LATEST"):
count = count + 1

else:
hostname = get_hostname(hstr_to_ip(host))
hostname = get_hostname(host)
if 'ostypes' in env.keys():
if 'xen' in env.ostypes[host]:
pass
Expand Down Expand Up @@ -204,7 +204,7 @@ def all_sm_reimage(build_param=None,smgr_client='/cs-shared/server-manager/clien
for esxi in esxi_hosts:
hosts.remove(esxi_hosts[esxi]['contrail_vm']['host'])
for host in hosts:
hostname = get_hostname(hstr_to_ip(host))
hostname = get_hostname(host)
if build_param is not None:
with settings(warn_only=True):
local("/cs-shared/server-manager/client/server-manager reimage --no_confirm --server_id %s %s" % (hostname,build_param))
Expand Down
4 changes: 2 additions & 2 deletions fabfile/utils/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ def get_all_hostnames():
return hostnames


def get_hostname(host_ip):
def get_hostname(host_string):
if isinstance(env.hostnames.get('all', None), list):
# Maintaining backward compatability with old testbed.py
hostnames = dict(zip(env.roledefs['all'], env.hostnames['all']))
else:
hostnames = env.hostnames
return hostnames[host_ip]
return hostnames[host_string]


def get_orchestrator():
Expand Down

0 comments on commit dda3988

Please sign in to comment.