Commit 0cf18b73 by Czémán Arnold

linux: remove unnecessary distro specific hostname setting

Issue: #21
parent f302ef53
...@@ -105,16 +105,8 @@ class Context(BaseContext): ...@@ -105,16 +105,8 @@ class Context(BaseContext):
@staticmethod @staticmethod
def set_hostname(hostname): def set_hostname(hostname):
if distro == 'debian':
with open('/etc/hostname', 'w') as f: with open('/etc/hostname', 'w') as f:
f.write(hostname) 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/hosts', 'w') as f: with open('/etc/hosts', 'w') as f:
f.write("127.0.0.1 localhost\n" 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