From b5f4c526ed94508bc4507f4ed04c87c0a1afa76e Mon Sep 17 00:00:00 2001 From: Marco Yuen Date: Thu, 10 Nov 2011 10:32:02 -0500 Subject: [PATCH] Fix hostname. --- sliver_libvirt.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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] -- 2.43.0