Executing parted with sudo in _write_partition (vm_utils.py)
This commit is contained in:
Salvatore Orlando 2011-03-24 22:31:39 +00:00 committed by Tarmac
commit 8c76aa7cd5

View File

@ -991,8 +991,8 @@ def _write_partition(virtual_size, dev):
def execute(*cmd, **kwargs):
return utils.execute(*cmd, **kwargs)
execute('parted', '--script', dest, 'mklabel', 'msdos')
execute('parted', '--script', dest, 'mkpart', 'primary',
execute('sudo', 'parted', '--script', dest, 'mklabel', 'msdos')
execute('sudo', 'parted', '--script', dest, 'mkpart', 'primary',
'%ds' % primary_first,
'%ds' % primary_last)