[*] complete code and constants migration from molecule-core to here

This commit is contained in:
Fabio Erculiani
2013-03-22 14:54:23 +00:00
parent 8401a2354f
commit 0960abaece
2 changed files with 24 additions and 6 deletions
+14 -2
View File
@@ -507,6 +507,18 @@ class IsoHandler(GenericExecutionStep, BuiltinHandlerMixin):
MD5_EXT = ".md5"
_cdrtools_mkisofs = "/usr/bin/mkisofs"
_iso_builder = _cdrtools_mkisofs
# support both cdrkit and cdrtools
_cdrkit_genisoimage = "/usr/bin/genisoimage"
if os.access(_cdrkit_genisoimage, os.X_OK) and \
os.path.exists(_cdrkit_genisoimage):
_iso_builder = _cdrkit_genisoimage
_iso_builder_builtin_args = [
"-J", "-R", "-l", "-no-emul-boot",
"-boot-load-size", "4", "-udf", "-boot-info-table"]
def __init__(self, *args, **kwargs):
GenericExecutionStep.__init__(self, *args, **kwargs)
@@ -618,8 +630,8 @@ class IsoHandler(GenericExecutionStep, BuiltinHandlerMixin):
)
)
args = [self._config['iso_builder']]
args.extend(self._config['iso_builder_builtin_args'])
args = [self._iso_builder]
args.extend(self._iso_builder_builtin_args)
args.extend(self.metadata.get('extra_mkisofs_parameters', []))
if self.iso_title.strip():
args.extend(["-V", self.iso_title[:32]])
+10 -4
View File
@@ -34,6 +34,12 @@ from .builtin_plugin import BuiltinHandlerMixin
class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
_iso_mounter = ["/bin/mount", "-o", "loop,ro", "-t", "iso9660"]
_iso_umounter = ["/bin/umount"]
_squash_mounter = ["/bin/mount", "-o", "loop,ro", "-t", "squashfs"]
_squash_umounter = ["/bin/umount"]
def __init__(self, *args, **kwargs):
GenericExecutionStep.__init__(self, *args, **kwargs)
@@ -75,7 +81,7 @@ class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
self.iso_image = self.metadata['source_iso']
# mount
mounter = self.metadata.get('iso_mounter', self._config['iso_mounter'])
mounter = self.metadata.get('iso_mounter', self._iso_mounter)
mount_args = mounter + [self.iso_image, self.tmp_mount]
self._output.output("[%s|%s] %s: %s" % (
blue("IsoUnpackHandler"), darkred(self.spec_name),
@@ -102,7 +108,7 @@ class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
# mount squash
mounter = self.metadata.get('squash_mounter',
self._config['squash_mounter'])
self._squash_mounter)
output_file = BuiltinCdrootHandler.chroot_compressor_output_file
if "chroot_compressor_output_file" in self.metadata:
@@ -174,7 +180,7 @@ class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
rc = 0
if self.squash_mounted:
umounter = self.metadata.get('squash_umounter',
self._config['squash_umounter'])
self._squash_umounter)
args = umounter + [self.tmp_squash_mount]
rc = molecule.utils.exec_cmd(args)
@@ -191,7 +197,7 @@ class IsoUnpackHandler(GenericExecutionStep, BuiltinHandlerMixin):
rc = 0
if self.iso_mounted:
umounter = self.metadata.get('iso_umounter',
self._config['iso_umounter'])
self._iso_umounter)
args = umounter + [self.tmp_mount]
rc = molecule.utils.exec_cmd(args)