From: Marco Yuen Date: Thu, 10 Nov 2011 15:32:02 +0000 (-0500) Subject: Fix hostname. X-Git-Tag: lxcbuild~4^2 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=b5f4c526ed94508bc4507f4ed04c87c0a1afa76e;p=nodemanager.git Fix hostname. --- diff --git a/sliver_libvirt.py b/sliver_libvirt.py index 6acc096..8456d95 100644 --- a/sliver_libvirt.py +++ b/sliver_libvirt.py @@ -72,9 +72,9 @@ class Sliver_LV(accounts.Account): command = ['cp', '-r', refImgDir, containerDir] logger.log_call(command, timeout=15*60) - # Set hostname + # Set hostname. A valid hostname cannot have '_' with open(os.path.join(containerDir, 'etc/hostname'), 'w') as f: - print >>f, name + print >>f, name.replace('_', '-') # Add unix account command = ['/usr/sbin/useradd', '-s', '/bin/sh', name]