Bug 1808369 - Upload-puppet-modules command if executed multiple times, then incorrectly creating the swift temp url
Summary: Upload-puppet-modules command if executed multiple times, then incorrectly cr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-tripleo-common
Version: 16.0 (Train)
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Alan Bishop
QA Contact: Sasha Smolyak
URL:
Whiteboard:
Depends On:
Blocks: 1824852
TreeView+ depends on / blocked
 
Reported: 2020-02-28 10:59 UTC by Rohini Diwakar
Modified: 2020-05-14 12:16 UTC (History)
11 users (show)

Fixed In Version: openstack-tripleo-common-11.3.3-0.20200317125554.81d9792.el8ost
Doc Type: Bug Fix
Doc Text:
This update fixes a bug that caused the `upload-puppet-modules` command to fail after the first invocation. A recent OpenStack command line interface update changed the OpenStack formats JSON data. That new format broke a script responsible for maintaining an internal URL used by the 'upload-puppet-modules' command. The script has been fixed to correctly handle the JSON data. Now the 'upload-puppet-modules' command functions correctly every time.
Clone Of:
Environment:
Last Closed: 2020-05-14 12:16:10 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Launchpad 1867135 0 None None None 2020-03-12 12:54:46 UTC
OpenStack gerrit 710793 0 None MERGED Improve upload-swift-artifacts handling of json data 2020-12-04 17:54:07 UTC
OpenStack gerrit 712672 0 None MERGED Fix upload-swift-artifacts handling of json data 2020-12-04 17:54:07 UTC
Red Hat Product Errata RHBA-2020:2114 0 None None None 2020-05-14 12:16:32 UTC

Description Rohini Diwakar 2020-02-28 10:59:36 UTC
Description of problem:
upload-puppet-modules command if executed multiple times, then incorrectly creates the swift temp url. In the first run of upload puppet modules, it's creating the swift temp url correctly. But on subsequent runs, it is creating the url incorrectly. New temp url does not contain "temp_url_sig" field.

Version-Release number of selected component (if applicable):
Red Hat Openstack 16.0


Steps to Reproduce:

1. Run upload-puppet-modules command 
$ cp -r /usr/share/openstack-puppet/modules/tripleo ~/puppet-modules
$ upload-puppet-modules --directory puppet-modules

2. Check swift temp url created
It will look like following.

[stack@undercloud ~]$ cat /home/stack/.tripleo/environments/puppet-modules-url.yaml
# Heat environment to deploy artifacts via Swift Temp URL(s)
parameter_defaults:
    DeployArtifactURLs:
    - 'http://172.172.3.83:8080/v1/AUTH_2ba8739bd95040d38337e5ecbb68e620/overcloud-artifacts/puppet-modules.tar.gz?temp_url_sig=8790e72a801e8d8ad016b850c7fa0044f605f94f&temp_url_expires=1614329134

3. Now run upload-puppet-modules command again. It will throw a warning and will complete with incorrect swift temp url.

(undercloud) [stack@director ~]$ upload-puppet-modules --directory puppet-modules

Creating tarball...
Tarball created.
/usr/bin/upload-swift-artifacts: line 132: [: {'Temp-Url-Key':: binary operator expected
Creating heat environment file: /home/stack/.tripleo/environments/puppet-modules-url.yaml
Uploading file to swift: /tmp/puppet-modules-Nm6O2gc/puppet-modules.tar.gz
+-----------------------+---------------------+----------------------------------+
| object                | container           | etag                             |
+-----------------------+---------------------+----------------------------------+
| puppet-modules.tar.gz | overcloud-artifacts | 66f9c13bb4ee7f8fb20421dbb2dd3231 |
+-----------------------+---------------------+----------------------------------+
Upload complete.
sha1: Option -hmac needs a value
sha1: Use -help for summary.


(undercloud) [stack@director ~]$ cat /home/stack/.tripleo/environments/puppet-modules-url.yaml
# Heat environment to deploy artifacts via Swift Temp URL(s)
parameter_defaults:
    DeployArtifactURLs:
    - 'http://192.168.24.3:8080/v1/AUTH_0440bfe31e4d4d0b8b1f323cc52a8466/overcloud-artifacts/puppet-modules.tar.gz?temp_url_sig=&temp_url_expires=1614422474'

Actual results:
Subsequent upload of modules return invalid temp-url.

Expected results:
It should return valid temp-url as it does in first run of upload-puppet-modules command.

Additional info:
In RHOSP13, running upload-puppet-modules multiple times always returned a valid url.

Comment 1 Alan Bishop 2020-03-12 12:55:06 UTC
I fixed this on upstream master, and proposed the patches to stable/train.

Comment 14 errata-xmlrpc 2020-05-14 12:16:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:2114


Note You need to log in before you can comment on or make changes to this bug.