diff --git a/common/tasks/apt.py b/common/tasks/apt.py index fe3e0c9..bb9086f 100644 --- a/common/tasks/apt.py +++ b/common/tasks/apt.py @@ -47,8 +47,11 @@ class AptUpgrade(Task): def run(self, info): log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'update']) - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', '-f', '-y', 'install']) - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', '-y', 'upgrade']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', + '--fix-broken', + '--assume-yes', + 'install']) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', '--assume-yes', 'upgrade']) class PurgeUnusedPackages(Task): diff --git a/common/tasks/filesystem.py b/common/tasks/filesystem.py index 529d03d..c0b5a75 100644 --- a/common/tasks/filesystem.py +++ b/common/tasks/filesystem.py @@ -60,7 +60,7 @@ class MountVolume(Task): raise TaskError(msg) log_check_call(['/bin/mount', - '-t', info.manifest.volume['filesystem'], + '--types', info.manifest.volume['filesystem'], info.bootstrap_device['partitions']['root_path'], info.root]) @@ -72,9 +72,9 @@ class MountSpecials(Task): def run(self, info): log_check_call(['/bin/mount', '--bind', '/dev', '{root}/dev'.format(root=info.root)]) - log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'proc', 'none', '/proc']) - log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'sysfs', 'none', '/sys']) - log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '-t', 'devpts', 'none', '/dev/pts']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '--types', 'proc', 'none', '/proc']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '--types', 'sysfs', 'none', '/sys']) + log_check_call(['/usr/sbin/chroot', info.root, '/bin/mount', '--types', 'devpts', 'none', '/dev/pts']) class UnmountSpecials(Task): diff --git a/common/tasks/host.py b/common/tasks/host.py index 93bafed..c377ecc 100644 --- a/common/tasks/host.py +++ b/common/tasks/host.py @@ -14,7 +14,7 @@ class CheckPackages(Task): from subprocess import CalledProcessError for package in info.host_packages: try: - log_check_call(['/usr/bin/dpkg', '-s', package]) + log_check_call(['/usr/bin/dpkg', '--status', package]) except CalledProcessError: msg = "The package ``{0}\'\' is not installed".format(package) raise TaskError(msg) diff --git a/common/tasks/initd.py b/common/tasks/initd.py index 2fd252c..377a3d9 100644 --- a/common/tasks/initd.py +++ b/common/tasks/initd.py @@ -42,7 +42,7 @@ class InstallInitScripts(Task): dst = os.path.join(info.root, 'etc/init.d', name) copy(src, dst) os.chmod(dst, rwxr_xr_x) - log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '-d', name]) + log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '--default', name]) for name in info.initd['disable']: - log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '-r', name]) + log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '--remove', name]) diff --git a/common/tasks/loopback.py b/common/tasks/loopback.py index 0541f7e..8ae20e1 100644 --- a/common/tasks/loopback.py +++ b/common/tasks/loopback.py @@ -46,7 +46,7 @@ class Detach(Task): after = [UnmountVolume] def run(self, info): - log_check_call(['/sbin/losetup', '-d', info.bootstrap_device['path']]) + log_check_call(['/sbin/losetup', '--detach', info.bootstrap_device['path']]) del info.bootstrap_device diff --git a/common/tasks/parted.py b/common/tasks/parted.py index caade0a..b5d0925 100644 --- a/common/tasks/parted.py +++ b/common/tasks/parted.py @@ -11,11 +11,11 @@ class PartitionVolume(Task): def run(self, info): # parted - log_check_call(['parted', '-a', 'optimal', '-s', info.bootstrap_device['path'], + log_check_call(['parted', '--align', 'optimal', '--script', info.bootstrap_device['path'], '--', 'mklabel', 'msdos']) - log_check_call(['parted', '-a', 'optimal', '-s', info.bootstrap_device['path'], + log_check_call(['parted', '--align', 'optimal', '--script', info.bootstrap_device['path'], '--', 'mkpart', 'primary', 'ext4', '32k', '-1']) - log_check_call(['parted', '-s', info.bootstrap_device['path'], + log_check_call(['parted', '--script', info.bootstrap_device['path'], '--', 'set', '1', 'boot', 'on']) @@ -25,8 +25,8 @@ class MapPartitions(Task): after = [PartitionVolume] def run(self, info): - root_partition_path = info.bootstrap_device['path'].replace('/dev', '/dev/mapper')+'p1' - log_check_call(['kpartx', '-a', '-v', info.bootstrap_device['path']]) + root_partition_path = info.bootstrap_device['path'].replace('/dev', '/dev/mapper')+'p1' + log_check_call(['kpartx', '-a', '-v', info.bootstrap_device['path']]) info.bootstrap_device['partitions'] = {'root_path': root_partition_path} @@ -37,6 +37,7 @@ class FormatPartitions(Task): after = [MapPartitions] def run(self, info): + # These params will fail for mkfs.xfs log_check_call(['/sbin/mkfs.{fs}'.format(fs=info.manifest.volume['filesystem']), '-m', '1', '-v', info.bootstrap_device['partitions']['root_path']]) diff --git a/plugins/backports/tasks.py b/plugins/backports/tasks.py index a17863e..add0e0d 100644 --- a/plugins/backports/tasks.py +++ b/plugins/backports/tasks.py @@ -33,4 +33,6 @@ class AddBackportsPackages(Task): from common.tools import log_check_call for pkg in info.manifest.plugins['backports']['packages']: - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'install', '-y', '-t', info.manifest.system['release'] + '-backports', pkg]) + log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/apt-get', 'install', + '--assume-yes', '--target-release', info.manifest.system['release'] + '-backports', + pkg]) diff --git a/plugins/opennebula/tasks.py b/plugins/opennebula/tasks.py index ad4f8b4..ca5778b 100644 --- a/plugins/opennebula/tasks.py +++ b/plugins/opennebula/tasks.py @@ -23,7 +23,8 @@ class OpenNebulaContext(Task): os.chmod(script_dst, rwxr_xr_x) from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/dpkg', '-i', '/tmp/one-context_3.8.1.deb']) + log_check_call(['/usr/sbin/chroot', info.root, + '/usr/bin/dpkg', '--install', '/tmp/one-context_3.8.1.deb']) # Fix start from common.tools import sed_i vmcontext_def = os.path.join(info.root, 'etc/init.d/vmcontext') diff --git a/plugins/user_packages/user_packages.py b/plugins/user_packages/user_packages.py index ceef601..1e8c147 100644 --- a/plugins/user_packages/user_packages.py +++ b/plugins/user_packages/user_packages.py @@ -42,4 +42,5 @@ class AddLocalUserPackages(Task): copy(script_src, script_dst) os.chmod(script_dst, rwxr_xr_x) - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/dpkg', '-i', '/tmp/'+os.path.basename(script_src)]) + log_check_call(['/usr/sbin/chroot', info.root, + '/usr/bin/dpkg', '--install', '/tmp/'+os.path.basename(script_src)]) diff --git a/providers/ec2/tasks/boot.py b/providers/ec2/tasks/boot.py index 229c88d..cee03e8 100644 --- a/providers/ec2/tasks/boot.py +++ b/providers/ec2/tasks/boot.py @@ -31,4 +31,5 @@ class ConfigureGrub(Task): from common.tools import log_check_call log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub']) - log_check_call(['/usr/sbin/chroot', info.root, '/bin/ln', '-s', '/boot/grub/grub.cfg', '/boot/grub/menu.lst']) + log_check_call(['/usr/sbin/chroot', info.root, + '/bin/ln', '--symbolic', '/boot/grub/grub.cfg', '/boot/grub/menu.lst'])