Skip to content
Snippets Groups Projects
Commit 1557b666 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

snf-mkimage: export image metadata as environ vars

Export the image metadata as environment variables before running
scripts on the mounted image. This way the metadata will be visible
and can be used by the scripts if needed.
parent 6fca0147
No related branches found
No related tags found
No related merge requests found
......@@ -346,6 +346,11 @@ def image_creator(options, out):
image.os.install_virtio_drivers()
if len(options.host_run) != 0:
# Export image metadata as environment variables to make them
# visible by the scripts
for key, value in image.meta.items():
os.environ["SNF_IMAGE_CREATOR_METADATA_%s" % key] = str(value)
out.info("Running scripts on the input media:")
mpoint = tempfile.mkdtemp()
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment