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
This commit is contained in:
Damien Ciabrini 2021-08-17 18:55:30 +02:00
parent 1a6d0d8013
commit 7428219d9f
2 changed files with 3 additions and 1 deletions

3
scripts/upload-artifacts Normal file → Executable file
View File

@ -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: []}}

View File

@ -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/*