From 7428219d9f6904970b9024680f1b0c331a26b36a Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Tue, 17 Aug 2021 18:55:30 +0200 Subject: [PATCH] Fix upload-artifacts and its installation Fix the content of DeployArtifactFILEs in the generated environment file. The absolute path of the artifact is now properly formatted, and the script correctly handles multiple files passed in parameters. Fix the installation of the script in setup.cfg. Tested manually with multiple artifacts, and via upload-puppet-modules (single artifact). Change-Id: I946df38ada9b2197076963e6140653f85d7c2cbc Closes-Bug: #1933336 --- scripts/upload-artifacts | 3 ++- setup.cfg | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) mode change 100644 => 100755 scripts/upload-artifacts diff --git a/scripts/upload-artifacts b/scripts/upload-artifacts old mode 100644 new mode 100755 index 6ad615e02..af4799495 --- a/scripts/upload-artifacts +++ b/scripts/upload-artifacts @@ -121,8 +121,9 @@ if [ -n "${ENVIRONMENT_FILE:-}" ]; then import os import yaml key = 'DeployArtifactFILEs' +files = ($(printf "'%s'," ${FILES[@]})) urls = [ - "/var/lib/tripleo/artifacts/${CONTAINER_NAME}/{}".format(i) + "/var/lib/tripleo/artifacts/${CONTAINER_NAME}/{}".format(os.path.basename(i)) for i in files ] content = {'parameter_defaults': {key: []}} diff --git a/setup.cfg b/setup.cfg index d93c963c0..e7df1404e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -34,6 +34,7 @@ scripts = scripts/tripleo-config-download scripts/upload-puppet-modules scripts/upload-swift-artifacts + scripts/upload-artifacts data_files = lib/heat/undercloud_heat_plugins = undercloud_heat_plugins/*