Compare commits

..

No commits in common. "09567eb82e4e2486d93a335a8e6d57927da340e2" and "4bf7f6673dc929a7f67c3c3c8cf36edd13c72a13" have entirely different histories.

2 changed files with 5 additions and 11 deletions

View File

@ -108,8 +108,7 @@ ALLOWED_TYPE_VARIANTS = {
"EC2": ["Base", "LVM"], "EC2": ["Base", "LVM"],
"GenericCloud": ["Base", "LVM"], "GenericCloud": ["Base", "LVM"],
"Vagrant": ["Libvirt", "Vbox", "VMware"], "Vagrant": ["Libvirt", "Vbox", "VMware"],
"OCP": None, "OCP": None
"RPI": None,
} }
def valid_type_variant(_type: str, variant: str="") -> bool: def valid_type_variant(_type: str, variant: str="") -> bool:
if _type not in ALLOWED_TYPE_VARIANTS: if _type not in ALLOWED_TYPE_VARIANTS:

View File

@ -107,11 +107,6 @@ class ImageBuild:
["tar", "-C", f"{self.outdir}", "--strip-components=1", "-x", "-f", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", "*/layer.tar"], ["tar", "-C", f"{self.outdir}", "--strip-components=1", "-x", "-f", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", "*/layer.tar"],
["xz", f"{self.outdir}/layer.tar"] ["xz", f"{self.outdir}/layer.tar"]
] ]
if self.image_type in ["RPI"]:
self.stage_commands = [
["cp", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.raw"],
["xz", f"{self.outdir}/{self.outname}.raw"]
]
if self.image_type in ["GenericCloud", "OCP"]: if self.image_type in ["GenericCloud", "OCP"]:
self.stage_commands = [ self.stage_commands = [
["qemu-img", "convert", "-c", "-f", "raw", "-O", "qcow2", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.qcow2"] ["qemu-img", "convert", "-c", "-f", "raw", "-O", "qcow2", lambda: f"{STORAGE_DIR}/{self.target_uuid}.body", f"{self.outdir}/{self.outname}.qcow2"]
@ -197,15 +192,15 @@ class ImageBuild:
return [param for name, param in args_mapping.items() if getattr(self.cli_args, name)] return [param for name, param in args_mapping.items() if getattr(self.cli_args, name)]
def _package_args(self) -> List[str]: def _package_args(self) -> List[str]:
if self.image_type in ["Container"]: if self.image_type == "Container":
return ["--parameter", "compress", "xz"] return ["--parameter", "compress", "xz"]
return [""] return [""]
def _common_args(self) -> List[str]: def _common_args(self) -> List[str]:
args = [] args = []
if self.image_type in ["Container"]: if self.image_type == "Container":
args = ["--parameter", "offline_icicle", "true"] args = ["--parameter", "offline_icicle", "true"]
if self.image_type in ["GenericCloud", "EC2", "Vagrant", "Azure", "OCP", "RPI"]: if self.image_type in ["GenericCloud", "EC2", "Vagrant", "Azure", "OCP"]:
args = ["--parameter", "generate_icicle", "false"] args = ["--parameter", "generate_icicle", "false"]
return args return args
@ -289,7 +284,7 @@ class ImageBuild:
def package(self) -> int: def package(self) -> int:
# Some build types don't need to be packaged by imagefactory # Some build types don't need to be packaged by imagefactory
# @TODO remove business logic if possible # @TODO remove business logic if possible
if self.image_type in ["GenericCloud", "EC2", "Azure", "Vagrant", "OCP", "RPI"]: if self.image_type in ["GenericCloud", "EC2", "Azure", "Vagrant", "OCP"]:
self.target_uuid = self.base_uuid if hasattr(self, 'base_uuid') else "" self.target_uuid = self.base_uuid if hasattr(self, 'base_uuid') else ""
if self.target_uuid: if self.target_uuid: