From 295cffefc773a6dde7cdc38e4c470eb23a32e3ab Mon Sep 17 00:00:00 2001 From: Steve Baker Date: Tue, 25 Jan 2022 09:28:34 +1300 Subject: [PATCH] Allow package install to be skipped for image build This allows the image build command to be called where the tripleo dependencies are installed via pip (even in a venv). This makes development of image builder elements more practical. Change-Id: I93ca15338c932d52c7eb007b36fcc29be19f8f1b --- tripleoclient/v1/overcloud_image.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tripleoclient/v1/overcloud_image.py b/tripleoclient/v1/overcloud_image.py index f3a44cecc..5b9891971 100644 --- a/tripleoclient/v1/overcloud_image.py +++ b/tripleoclient/v1/overcloud_image.py @@ -81,6 +81,13 @@ class BuildOvercloudImage(command.Command): default=True, help=_("Skip build if cached image exists."), ) + parser.add_argument( + "--no-package-install", + dest="package_install", + action="store_false", + default=True, + help=_("Skip installing required packages."), + ) parser.add_argument( "--output-directory", dest="output_directory", @@ -106,7 +113,8 @@ class BuildOvercloudImage(command.Command): def take_action(self, parsed_args): self.log.debug("take_action(%s)" % parsed_args) - self._ensure_packages_installed() + if parsed_args.package_install: + self._ensure_packages_installed() if not parsed_args.config_files: parsed_args.config_files = [os.path.join(self.IMAGE_YAML_PATH, f)