diff --git a/base/fs/partitionmaps/abstract.py b/base/fs/partitionmaps/abstract.py index 831d048..45f7814 100644 --- a/base/fs/partitionmaps/abstract.py +++ b/base/fs/partitionmaps/abstract.py @@ -37,13 +37,13 @@ class AbstractPartitionMap(FSMProxy): def _before_map(self, event): volume = event.volume try: - mappings = log_check_call(['/sbin/kpartx', '-l', volume.device_path]) + mappings = log_check_call(['kpartx', '-l', volume.device_path]) import re regexp = re.compile('^(?P.+[^\d](?P\d+)) : ' '(?P\d) (?P\d+) ' '{device_path} (?P\d+)$' .format(device_path=volume.device_path)) - log_check_call(['/sbin/kpartx', '-a', volume.device_path]) + log_check_call(['kpartx', '-a', volume.device_path]) import os.path for mapping in mappings: match = regexp.match(mapping) @@ -61,7 +61,7 @@ class AbstractPartitionMap(FSMProxy): for partition in self.partitions: if not partition.fsm.can('unmap'): partition.unmap() - log_check_call(['/sbin/kpartx', '-d', volume.device_path]) + log_check_call(['kpartx', '-d', volume.device_path]) raise e def unmap(self, volume): @@ -73,6 +73,6 @@ class AbstractPartitionMap(FSMProxy): if partition.fsm.cannot('unmap'): msg = 'The partition {partition} prevents the unmap procedure'.format(partition=partition) raise PartitionError(msg) - log_check_call(['/sbin/kpartx', '-d', volume.device_path]) + log_check_call(['kpartx', '-d', volume.device_path]) for partition in self.partitions: partition.unmap() diff --git a/base/fs/partitionmaps/gpt.py b/base/fs/partitionmaps/gpt.py index 12f3383..50ed2ab 100644 --- a/base/fs/partitionmaps/gpt.py +++ b/base/fs/partitionmaps/gpt.py @@ -46,7 +46,7 @@ class GPTPartitionMap(AbstractPartitionMap): def _before_create(self, event): volume = event.volume - log_check_call(['/sbin/parted', '--script', '--align', 'none', volume.device_path, + log_check_call(['parted', '--script', '--align', 'none', volume.device_path, '--', 'mklabel', 'gpt']) for partition in self.partitions: partition.create(volume) diff --git a/base/fs/partitionmaps/msdos.py b/base/fs/partitionmaps/msdos.py index 988178a..1634842 100644 --- a/base/fs/partitionmaps/msdos.py +++ b/base/fs/partitionmaps/msdos.py @@ -36,7 +36,7 @@ class MSDOSPartitionMap(AbstractPartitionMap): def _before_create(self, event): volume = event.volume - log_check_call(['/sbin/parted', '--script', '--align', 'none', volume.device_path, + log_check_call(['parted', '--script', '--align', 'none', volume.device_path, '--', 'mklabel', 'msdos']) for partition in self.partitions: partition.create(volume) diff --git a/base/fs/partitions/abstract.py b/base/fs/partitions/abstract.py index f987bfb..6aae8c1 100644 --- a/base/fs/partitions/abstract.py +++ b/base/fs/partitions/abstract.py @@ -26,14 +26,14 @@ class AbstractPartition(FSMProxy): if isinstance(self.source, AbstractPartition): self.source.mount(destination=mount_dir) else: - log_check_call(['/bin/mount'] + self.opts + [self.source, mount_dir]) + log_check_call(['mount'] + self.opts + [self.source, mount_dir]) self.mount_dir = mount_dir def unmount(self): if isinstance(self.source, AbstractPartition): self.source.unmount() else: - log_check_call(['/bin/umount', self.mount_dir]) + log_check_call(['umount', self.mount_dir]) del self.mount_dir def __init__(self, size, filesystem, format_command): @@ -47,7 +47,7 @@ class AbstractPartition(FSMProxy): super(AbstractPartition, self).__init__(cfg) def get_uuid(self): - [uuid] = log_check_call(['/sbin/blkid', '-s', 'UUID', '-o', 'value', self.device_path]) + [uuid] = log_check_call(['blkid', '-s', 'UUID', '-o', 'value', self.device_path]) return uuid @abstractmethod @@ -59,7 +59,7 @@ class AbstractPartition(FSMProxy): def _before_format(self, e): if self.format_command is None: - format_command = ['/sbin/mkfs.{fs}', '{device_path}'] + format_command = ['mkfs.{fs}', '{device_path}'] else: format_command = self.format_command variables = {'fs': self.filesystem, @@ -70,7 +70,7 @@ class AbstractPartition(FSMProxy): log_check_call(command) def _before_mount(self, e): - log_check_call(['/bin/mount', '--types', self.filesystem, self.device_path, e.destination]) + log_check_call(['mount', '--types', self.filesystem, self.device_path, e.destination]) self.mount_dir = e.destination def _after_mount(self, e): @@ -80,7 +80,7 @@ class AbstractPartition(FSMProxy): def _before_unmount(self, e): for destination in sorted(self.mounts.iterkeys(), key=len, reverse=True): self.mounts[destination].unmount() - log_check_call(['/bin/umount', self.mount_dir]) + log_check_call(['umount', self.mount_dir]) del self.mount_dir def add_mount(self, source, destination, opts=[]): diff --git a/base/fs/partitions/base.py b/base/fs/partitions/base.py index 78b7e74..d8544f8 100644 --- a/base/fs/partitions/base.py +++ b/base/fs/partitions/base.py @@ -44,11 +44,11 @@ class BasePartition(AbstractPartition): create_command = ('mkpart primary {start} {end}' .format(start=str(self.get_start()), end=str(self.get_end()))) - log_check_call(['/sbin/parted', '--script', '--align', 'none', e.volume.device_path, + log_check_call(['parted', '--script', '--align', 'none', e.volume.device_path, '--', create_command]) for flag in self.flags: - log_check_call(['/sbin/parted', '--script', e.volume.device_path, + log_check_call(['parted', '--script', e.volume.device_path, '--', ('set {idx} {flag} on' .format(idx=str(self.get_index()), flag=flag))]) diff --git a/base/fs/partitions/gpt.py b/base/fs/partitions/gpt.py index 52996ab..8dce6dd 100644 --- a/base/fs/partitions/gpt.py +++ b/base/fs/partitions/gpt.py @@ -14,5 +14,5 @@ class GPTPartition(BasePartition): name_command = ('name {idx} {name}' .format(idx=self.get_index(), name=self.name)) - log_check_call(['/sbin/parted', '--script', e.volume.device_path, + log_check_call(['parted', '--script', e.volume.device_path, '--', name_command]) diff --git a/base/fs/partitions/gpt_swap.py b/base/fs/partitions/gpt_swap.py index 4af9245..e5fdc3d 100644 --- a/base/fs/partitions/gpt_swap.py +++ b/base/fs/partitions/gpt_swap.py @@ -8,4 +8,4 @@ class GPTSwapPartition(GPTPartition): super(GPTSwapPartition, self).__init__(size, 'swap', None, 'swap', previous) def _before_format(self, e): - log_check_call(['/sbin/mkswap', self.device_path]) + log_check_call(['mkswap', self.device_path]) diff --git a/base/fs/partitions/msdos_swap.py b/base/fs/partitions/msdos_swap.py index f4e0339..18c30ff 100644 --- a/base/fs/partitions/msdos_swap.py +++ b/base/fs/partitions/msdos_swap.py @@ -8,4 +8,4 @@ class MSDOSSwapPartition(MSDOSPartition): super(MSDOSSwapPartition, self).__init__(size, 'swap', None, previous) def _before_format(self, e): - log_check_call(['/sbin/mkswap', self.device_path]) + log_check_call(['mkswap', self.device_path]) diff --git a/base/fs/volume.py b/base/fs/volume.py index 631c886..9f61541 100644 --- a/base/fs/volume.py +++ b/base/fs/volume.py @@ -76,12 +76,12 @@ class Volume(FSMProxy): if not hasattr(self, 'dm_node_name'): raise VolumeError('Unable to find a free block device path for mounting the bootstrap volume') - log_check_call(['/sbin/dmsetup', 'create', self.dm_node_name], table) + log_check_call(['dmsetup', 'create', self.dm_node_name], table) self.unlinked_device_path = self.device_path self.device_path = self.dm_node_path def _before_unlink_dm_node(self, e): - log_check_call(['/sbin/dmsetup', 'remove', self.dm_node_name]) + log_check_call(['dmsetup', 'remove', self.dm_node_name]) del self.dm_node_name del self.dm_node_path self.device_path = self.unlinked_device_path diff --git a/common/fs/loopbackvolume.py b/common/fs/loopbackvolume.py index 9f42728..87dfc1a 100644 --- a/common/fs/loopbackvolume.py +++ b/common/fs/loopbackvolume.py @@ -12,14 +12,14 @@ class LoopbackVolume(Volume): def _before_create(self, e): self.image_path = e.image_path vol_size = str(self.size.get_qty_in('MiB')) + 'M' - log_check_call(['/usr/bin/qemu-img', 'create', '-f', 'raw', self.image_path, vol_size]) + log_check_call(['qemu-img', 'create', '-f', 'raw', self.image_path, vol_size]) def _before_attach(self, e): - [self.loop_device_path] = log_check_call(['/sbin/losetup', '--show', '--find', self.image_path]) + [self.loop_device_path] = log_check_call(['losetup', '--show', '--find', self.image_path]) self.device_path = self.loop_device_path def _before_detach(self, e): - log_check_call(['/sbin/losetup', '--detach', self.loop_device_path]) + log_check_call(['losetup', '--detach', self.loop_device_path]) del self.loop_device_path del self.device_path diff --git a/common/fs/qemuvolume.py b/common/fs/qemuvolume.py index 3383a0c..82091f8 100644 --- a/common/fs/qemuvolume.py +++ b/common/fs/qemuvolume.py @@ -9,7 +9,7 @@ class QEMUVolume(LoopbackVolume): def _before_create(self, e): self.image_path = e.image_path vol_size = str(self.size.get_qty_in('MiB')) + 'M' - log_check_call(['/usr/bin/qemu-img', 'create', '-f', self.qemu_format, self.image_path, vol_size]) + log_check_call(['qemu-img', 'create', '-f', self.qemu_format, self.image_path, vol_size]) def _check_nbd_module(self): from base.fs.partitionmaps.none import NoPartitions @@ -40,11 +40,11 @@ class QEMUVolume(LoopbackVolume): def _before_attach(self, e): self._check_nbd_module() self.loop_device_path = self._find_free_nbd_device() - log_check_call(['/usr/bin/qemu-nbd', '--connect', self.loop_device_path, self.image_path]) + log_check_call(['qemu-nbd', '--connect', self.loop_device_path, self.image_path]) self.device_path = self.loop_device_path def _before_detach(self, e): - log_check_call(['/usr/bin/qemu-nbd', '--disconnect', self.loop_device_path]) + log_check_call(['qemu-nbd', '--disconnect', self.loop_device_path]) del self.loop_device_path del self.device_path diff --git a/common/tasks/apt.py b/common/tasks/apt.py index d39d0bf..a303600 100644 --- a/common/tasks/apt.py +++ b/common/tasks/apt.py @@ -87,8 +87,8 @@ class AptUpdate(Task): @classmethod def run(cls, info): - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'update']) + log_check_call(['chroot', info.root, + 'apt-get', 'update']) class AptUpgrade(Task): @@ -100,15 +100,15 @@ class AptUpgrade(Task): def run(cls, info): from subprocess import CalledProcessError try: - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'install', - '--fix-broken', - '--no-install-recommends', - '--assume-yes']) - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'upgrade', - '--no-install-recommends', - '--assume-yes']) + log_check_call(['chroot', info.root, + 'apt-get', 'install', + '--fix-broken', + '--no-install-recommends', + '--assume-yes']) + log_check_call(['chroot', info.root, + 'apt-get', 'upgrade', + '--no-install-recommends', + '--assume-yes']) except CalledProcessError as e: if e.returncode == 100: import logging @@ -125,9 +125,9 @@ class PurgeUnusedPackages(Task): @classmethod def run(cls, info): - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'autoremove', - '--purge']) + log_check_call(['chroot', info.root, + 'apt-get', 'autoremove', + '--purge']) class AptClean(Task): @@ -136,8 +136,8 @@ class AptClean(Task): @classmethod def run(cls, info): - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'clean']) + log_check_call(['chroot', info.root, + 'apt-get', 'clean']) lists = os.path.join(info.root, 'var/lib/apt/lists') for list_file in [os.path.join(lists, f) for f in os.listdir(lists)]: diff --git a/common/tasks/boot.py b/common/tasks/boot.py index d66d97a..271598f 100644 --- a/common/tasks/boot.py +++ b/common/tasks/boot.py @@ -91,9 +91,9 @@ class InstallGrub(Task): idx=idx + 1)) # Install grub - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/sbin/grub-install', device_path]) - log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/update-grub']) + log_check_call(['chroot', info.root, + 'grub-install', device_path]) + log_check_call(['chroot', info.root, 'update-grub']) except Exception as e: if isinstance(info.volume, LoopbackVolume): remount(info.volume, unlink_fn) @@ -127,12 +127,12 @@ class InstallExtLinux(Task): bootloader = '/usr/lib/syslinux/gptmbr.bin' else: bootloader = '/usr/lib/extlinux/mbr.bin' - log_check_call(['/usr/sbin/chroot', info.root, - '/bin/dd', 'bs=440', 'count=1', + log_check_call(['chroot', info.root, + 'dd', 'bs=440', 'count=1', 'if=' + bootloader, 'of=' + info.volume.device_path]) - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/extlinux', + log_check_call(['chroot', info.root, + 'extlinux', '--install', '/boot/extlinux']) - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/sbin/extlinux-update']) + log_check_call(['chroot', info.root, + 'extlinux-update']) diff --git a/common/tasks/bootstrap.py b/common/tasks/bootstrap.py index 42d89ba..5aa04c4 100644 --- a/common/tasks/bootstrap.py +++ b/common/tasks/bootstrap.py @@ -17,7 +17,7 @@ class AddRequiredCommands(Task): def get_bootstrap_args(info): - executable = ['/usr/sbin/debootstrap'] + executable = ['debootstrap'] options = ['--arch=' + info.manifest.system['architecture']] if len(info.include_packages) > 0: options.append('--include=' + ','.join(info.include_packages)) diff --git a/common/tasks/cleanup.py b/common/tasks/cleanup.py index c6cc3c1..cd01854 100644 --- a/common/tasks/cleanup.py +++ b/common/tasks/cleanup.py @@ -29,7 +29,7 @@ class ShredHostkeys(Task): public = [path + '.pub' for path in private] from common.tools import log_check_call - log_check_call(['/usr/bin/shred', '--remove'] + private + public) + log_check_call(['shred', '--remove'] + private + public) class CleanTMP(Task): diff --git a/common/tasks/filesystem.py b/common/tasks/filesystem.py index b8f87c7..769ed12 100644 --- a/common/tasks/filesystem.py +++ b/common/tasks/filesystem.py @@ -43,7 +43,7 @@ class TuneVolumeFS(Task): for partition in info.volume.partition_map.partitions: if not isinstance(partition, UnformattedPartition): if re.match('^ext[2-4]$', partition.filesystem) is not None: - log_check_call(['/sbin/tune2fs', '-i', '0', partition.device_path]) + log_check_call(['tune2fs', '-i', '0', partition.device_path]) class AddXFSProgs(Task): diff --git a/common/tasks/initd.py b/common/tasks/initd.py index 99842f6..23e2c14 100644 --- a/common/tasks/initd.py +++ b/common/tasks/initd.py @@ -21,10 +21,10 @@ 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', '--default', name]) + log_check_call(['chroot', info.root, 'insserv', '--default', name]) for name in info.initd['disable']: - log_check_call(['/usr/sbin/chroot', info.root, '/sbin/insserv', '--remove', name]) + log_check_call(['chroot', info.root, 'insserv', '--remove', name]) class AddExpandRoot(Task): @@ -49,8 +49,8 @@ class AddSSHKeyGeneration(Task): install = info.initd['install'] from subprocess import CalledProcessError try: - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/dpkg-query', '-W', 'openssh-server']) + log_check_call(['chroot', info.root, + 'dpkg-query', '-W', 'openssh-server']) if info.manifest.system['release'] == 'squeeze': install['generate-ssh-hostkeys'] = os.path.join(init_scripts_dir, 'squeeze/generate-ssh-hostkeys') else: diff --git a/common/tasks/locale.py b/common/tasks/locale.py index 7eb15e4..970e5af 100644 --- a/common/tasks/locale.py +++ b/common/tasks/locale.py @@ -28,12 +28,12 @@ class GenerateLocale(Task): search = '# ' + locale_str sed_i(locale_gen, search, locale_str) - log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/locale-gen']) + log_check_call(['chroot', info.root, 'locale-gen']) lang = '{locale}.{charmap}'.format(locale=info.manifest.system['locale'], charmap=info.manifest.system['charmap']) - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/sbin/update-locale', 'LANG=' + lang]) + log_check_call(['chroot', info.root, + 'update-locale', 'LANG=' + lang]) class SetTimezone(Task): diff --git a/common/tasks/packages.py b/common/tasks/packages.py index bf171e7..d5bc921 100644 --- a/common/tasks/packages.py +++ b/common/tasks/packages.py @@ -45,10 +45,10 @@ class InstallPackages(Task): try: env = os.environ.copy() env['DEBIAN_FRONTEND'] = 'noninteractive' - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/apt-get', 'install', - '--no-install-recommends', - '--assume-yes'] + log_check_call(['chroot', info.root, + 'apt-get', 'install', + '--no-install-recommends', + '--assume-yes'] + map(str, remote_packages), env=env) except CalledProcessError as e: @@ -90,8 +90,8 @@ class InstallPackages(Task): env = os.environ.copy() env['DEBIAN_FRONTEND'] = 'noninteractive' - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/dpkg', '--install'] + log_check_call(['chroot', info.root, + 'dpkg', '--install'] + chrooted_package_paths, env=env) diff --git a/common/tasks/security.py b/common/tasks/security.py index ef109ee..e4339ba 100644 --- a/common/tasks/security.py +++ b/common/tasks/security.py @@ -10,7 +10,7 @@ class EnableShadowConfig(Task): @classmethod def run(cls, info): from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, '/sbin/shadowconfig', 'on']) + log_check_call(['chroot', info.root, 'shadowconfig', 'on']) class DisableSSHPasswordAuthentication(Task): diff --git a/plugins/admin_user/tasks.py b/plugins/admin_user/tasks.py index eb572e8..ab0131d 100644 --- a/plugins/admin_user/tasks.py +++ b/plugins/admin_user/tasks.py @@ -22,8 +22,8 @@ class CreateAdminUser(Task): @classmethod def run(cls, info): from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/sbin/useradd', + log_check_call(['chroot', info.root, + 'useradd', '--create-home', '--shell', '/bin/bash', info.manifest.plugins['admin_user']['username']]) @@ -65,8 +65,8 @@ class DisableRootLogin(Task): from subprocess import CalledProcessError from common.tools import log_check_call try: - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/dpkg-query', '-W', 'openssh-server']) + log_check_call(['chroot', info.root, + 'dpkg-query', '-W', 'openssh-server']) from common.tools import sed_i sshdconfig_path = os.path.join(info.root, 'etc/ssh/sshd_config') sed_i(sshdconfig_path, 'PermitRootLogin yes', 'PermitRootLogin no') diff --git a/plugins/cloud_init/tasks.py b/plugins/cloud_init/tasks.py index 75700bd..b4a6932 100644 --- a/plugins/cloud_init/tasks.py +++ b/plugins/cloud_init/tasks.py @@ -68,7 +68,7 @@ class SetMetadataSource(Task): logging.getLogger(__name__).warn(msg) return sources = "cloud-init cloud-init/datasources multiselect " + sources - log_check_call(['/usr/sbin/chroot', info.root, '/usr/bin/debconf-set-selections'], sources) + log_check_call(['chroot', info.root, 'debconf-set-selections'], sources) class DisableModules(Task): diff --git a/plugins/opennebula/tasks.py b/plugins/opennebula/tasks.py index ecb5bb3..c9ea35b 100644 --- a/plugins/opennebula/tasks.py +++ b/plugins/opennebula/tasks.py @@ -27,7 +27,7 @@ class OpenNebulaContext(Task): sed_i(vmcontext_def, '# Default-Start:', '# Default-Start: 2 3 4 5') from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, 'update-rc.d', 'vmcontext', 'start', + log_check_call(['chroot', info.root, 'update-rc.d', 'vmcontext', 'start', '90', '2', '3', '4', '5', 'stop', '90', '0', '6']) from shutil import copy diff --git a/plugins/puppet/tasks.py b/plugins/puppet/tasks.py index 8b0559c..5545bf1 100644 --- a/plugins/puppet/tasks.py +++ b/plugins/puppet/tasks.py @@ -84,8 +84,8 @@ class ApplyPuppetManifest(Task): manifest_path = os.path.join('/', manifest_rel_dst) from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/puppet', 'apply', manifest_path]) + log_check_call(['chroot', info.root, + 'puppet', 'apply', manifest_path]) os.remove(manifest_dst) from common.tools import sed_i diff --git a/plugins/root_password/tasks.py b/plugins/root_password/tasks.py index 85776cc..53ad7fe 100644 --- a/plugins/root_password/tasks.py +++ b/plugins/root_password/tasks.py @@ -9,5 +9,5 @@ class SetRootPassword(Task): @classmethod def run(cls, info): from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/chpasswd'], + log_check_call(['chroot', info.root, 'chpasswd'], 'root:' + info.manifest.plugins['root_password']['password']) diff --git a/plugins/vagrant/tasks.py b/plugins/vagrant/tasks.py index 4118e08..2d7e178 100644 --- a/plugins/vagrant/tasks.py +++ b/plugins/vagrant/tasks.py @@ -71,8 +71,8 @@ class CreateVagrantUser(Task): @classmethod def run(cls, info): from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/sbin/useradd', + log_check_call(['chroot', info.root, + 'useradd', '--create-home', '--shell', '/bin/bash', 'vagrant']) @@ -115,8 +115,8 @@ class AddInsecurePublicKey(Task): # We can't do this directly with python, since getpwnam gets its info from the host from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, - '/bin/chown', 'vagrant:vagrant', + log_check_call(['chroot', info.root, + 'chown', 'vagrant:vagrant', '/home/vagrant/.ssh', '/home/vagrant/.ssh/authorized_keys']) @@ -127,7 +127,7 @@ class SetRootPassword(Task): @classmethod def run(cls, info): from common.tools import log_check_call - log_check_call(['/usr/sbin/chroot', info.root, '/usr/sbin/chpasswd'], 'root:vagrant') + log_check_call(['chroot', info.root, 'chpasswd'], 'root:vagrant') class PackageBox(Task): diff --git a/providers/ec2/tasks/ami.py b/providers/ec2/tasks/ami.py index 28de349..456d269 100644 --- a/providers/ec2/tasks/ami.py +++ b/providers/ec2/tasks/ami.py @@ -39,7 +39,7 @@ class BundleImage(Task): bundle_name = 'bundle-{id}'.format(id=info.run_id) info.bundle_path = os.path.join(info.workspace, bundle_name) arch = {'i386': 'i386', 'amd64': 'x86_64'}.get(info.manifest.system['architecture']) - log_check_call(['/usr/bin/euca-bundle-image', + log_check_call(['euca-bundle-image', '--image', info.volume.image_path, '--arch', arch, '--user', info.credentials['user-id'], @@ -65,7 +65,7 @@ class UploadImage(Task): else: s3_url = 'https://s3-{region}.amazonaws.com/'.format(region=info.host['region']) info.manifest.manifest_location = info.manifest.image['bucket'] + '/' + info.ami_name + '.manifest.xml' - log_check_call(['/usr/bin/euca-upload-bundle', + log_check_call(['euca-upload-bundle', '--bucket', info.manifest.image['bucket'], '--manifest', manifest_file, '--access-key', info.credentials['access-key'], diff --git a/providers/ec2/tasks/boot.py b/providers/ec2/tasks/boot.py index 399cbac..7c7c1e3 100644 --- a/providers/ec2/tasks/boot.py +++ b/providers/ec2/tasks/boot.py @@ -45,6 +45,6 @@ class ConfigurePVGrub(Task): 'GRUB_HIDDEN_TIMEOUT=true') 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', '--symbolic', '/boot/grub/grub.cfg', '/boot/grub/menu.lst']) + log_check_call(['chroot', info.root, 'update-grub']) + log_check_call(['chroot', info.root, + 'ln', '--symbolic', '/boot/grub/grub.cfg', '/boot/grub/menu.lst']) diff --git a/providers/ec2/tasks/network.py b/providers/ec2/tasks/network.py index cbaf4ac..6c13a32 100644 --- a/providers/ec2/tasks/network.py +++ b/providers/ec2/tasks/network.py @@ -40,17 +40,17 @@ class InstallEnhancedNetworking(Task): urllib.urlretrieve(drivers_url, archive) from common.tools import log_check_call - log_check_call('/bin/tar', '--ungzip', - '--extract', - '--file', archive, - '--directory', os.path.join(info.root, 'tmp')) + log_check_call('tar', '--ungzip', + '--extract', + '--file', archive, + '--directory', os.path.join(info.root, 'tmp')) src_dir = os.path.join('/tmp', os.path.basename(drivers_url), 'src') - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/make', '--directory', src_dir]) - log_check_call(['/usr/sbin/chroot', info.root, - '/usr/bin/make', 'install', - '--directory', src_dir]) + log_check_call(['chroot', info.root, + 'make', '--directory', src_dir]) + log_check_call(['chroot', info.root, + 'make', 'install', + '--directory', src_dir]) ixgbevf_conf_path = os.path.join(info.root, 'etc/modprobe.d/ixgbevf.conf') with open(ixgbevf_conf_path, 'w') as ixgbevf_conf: diff --git a/providers/virtualbox/tasks/guest_additions.py b/providers/virtualbox/tasks/guest_additions.py index 37dd537..1277f42 100644 --- a/providers/virtualbox/tasks/guest_additions.py +++ b/providers/virtualbox/tasks/guest_additions.py @@ -29,8 +29,8 @@ class AddGuestAdditionsPackages(Task): info.packages.add('dkms') from common.tools import log_check_call - [kernel_version] = log_check_call(['/usr/sbin/chroot', info.root, - '/bin/uname', '-r']) + [kernel_version] = log_check_call(['chroot', info.root, + 'uname', '-r']) kernel_headers_pkg = 'linux-headers-{version}'.format(version=kernel_version) info.packages.add(kernel_headers_pkg) @@ -52,7 +52,7 @@ class InstallGuestAdditions(Task): install_script = os.path.join('/', mount_dir, 'VBoxLinuxAdditions.run') from common.tools import log_call - status, out, err = log_call(['/usr/sbin/chroot', info.root, + status, out, err = log_call(['chroot', info.root, install_script, '--nox11']) # Install will exit with $?=1 because X11 isn't installed if status != 1: