Browse Source

Add --temp-dir to overcloud image build

By default, DIB puts the temp folders it uses in /tmp. In newer
versions, this can cause images to go missing because systemd will
cleanup tmp (see tmpfiles.d) which may cause files and directories in
the image to missing. This change adds a --temp-dir option to the cli
which by default will configure TMPDIR to be the current working
directory if not specified.

Change-Id: Ib5f82a175266675d9639416dd664604bee370a1d
Closes-Bug: #1879766
tags/13.6.0^0
Alex Schultz 2 weeks ago
parent
commit
4c7df58d9b
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      tripleoclient/v1/overcloud_image.py

+ 8
- 0
tripleoclient/v1/overcloud_image.py View File

@@ -81,6 +81,13 @@ class BuildOvercloudImage(command.Command):
help=_("Output directory for images. Defaults to $TRIPLEO_ROOT,"
"or current directory if unset."),
)
parser.add_argument(
"--temp-dir",
dest="temp_dir",
default=os.environ.get('TMPDIR', os.getcwd()),
help=_("Temporary directory to use when building the images. "
"Defaults to $TMPDIR or current directory if unset."),
)
return parser

def take_action(self, parsed_args):
@@ -89,6 +96,7 @@ class BuildOvercloudImage(command.Command):
if not parsed_args.config_files:
parsed_args.config_files = [os.path.join(self.IMAGE_YAML_PATH, f)
for f in self.DEFAULT_YAML]
os.environ.update({'TMPDIR': parsed_args.temp_dir})
manager = build.ImageBuildManager(
parsed_args.config_files,
output_directory=parsed_args.output_directory,


Loading…
Cancel
Save