X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sliver_libvirt.py;h=b991556a273b03b885a8bf98192ad2ecdde567ae;hb=2fbc810bde9fa8b3acb277f4d6157341073c7b6a;hp=8456d95ff7eb0cfc1cce9b30e196615883bc7ce7;hpb=b5f4c526ed94508bc4507f4ed04c87c0a1afa76e;p=nodemanager.git diff --git a/sliver_libvirt.py b/sliver_libvirt.py index 8456d95..b991556 100644 --- a/sliver_libvirt.py +++ b/sliver_libvirt.py @@ -76,8 +76,12 @@ class Sliver_LV(accounts.Account): with open(os.path.join(containerDir, 'etc/hostname'), 'w') as f: print >>f, name.replace('_', '-') + # Add slices group if not already present + command = ['/usr/sbin/groupadd slices'] + logger.log_call(command, timeout=15*60) + # Add unix account - command = ['/usr/sbin/useradd', '-s', '/bin/sh', name] + command = ['/usr/sbin/useradd', '-g', 'slices', '-s', '/bin/sh', name, '-p', '*'] logger.log_call(command, timeout=15*60) # Get a connection and lookup for the sliver before actually @@ -99,7 +103,7 @@ class Sliver_LV(accounts.Account): conn = Sliver_LV.getConnection() try: - command = ['/usr/sbin/userdel', name] + command = ['/usr/sbin/userdel', '-r', name] logger.log_call(command, timeout=15*60) # Destroy libvirt domain