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
This commit is contained in:
Steve Baker 2022-01-25 09:28:34 +13:00
parent bb267fe5f5
commit 295cffefc7
1 changed files with 9 additions and 1 deletions

View File

@ -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)