Commit 145e2a6d by Czémán Arnold

Merge branch 'issue_21' into 'master'

linux: remove unnecessary distro specific hostname setting

See merge request !13
parents f302ef53 0cf18b73
......@@ -105,16 +105,8 @@ class Context(BaseContext):
@staticmethod
def set_hostname(hostname):
if distro == 'debian':
with open('/etc/hostname', 'w') as f:
f.write(hostname)
elif distro == 'rhel':
for line in fileinput.input('/etc/sysconfig/network',
inplace=1):
if line.startswith('HOSTNAME='):
print 'HOSTNAME=%s' % hostname
else:
print line.rstrip()
with open('/etc/hostname', 'w') as f:
f.write(hostname)
with open('/etc/hosts', 'w') as f:
f.write("127.0.0.1 localhost\n"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment