Merge "Update the command to change the hostname"

This commit is contained in:
Zuul 2018-06-08 21:13:50 +00:00 committed by Gerrit Code Review
commit 5edc50b8ee
1 changed files with 4 additions and 2 deletions

View File

@ -166,11 +166,13 @@ class Engine(object):
def _configure_instance_etc_hosts(self, instance, cluster):
LOG.debug('Configuring "/etc/hosts" of instance.')
hosts_file = cluster_utils.generate_etc_hosts(cluster)
hostname = instance.fqdn()
with instance.remote() as r:
r.write_file_to('etc-hosts', hosts_file)
r.execute_command('sudo hostname %s' % instance.fqdn())
r.write_file_to('etc-hostname', hostname)
r.execute_command('sudo hostname %s' % hostname)
r.execute_command('sudo mv etc-hosts /etc/hosts')
r.execute_command('sudo mv etc-hostname /etc/hostname')
r.execute_command('sudo usermod -s /bin/bash $USER')
def _configure_instance_resolve_conf(self, instance):