Pass in --region flag to sstream-mirror-glance

It seems that in spite of the charm properly setting the OS_REGION_NAME,
in some cases, that variable is not inspected and the prefered region is
never considered by sstream-mirror-glance when mirroring images.

In environments where we have a multi-region shared keystone, the wrong
region is selected and the upload times out or errs out. This is just
one part of the fix, the other part is in sstream-mirror-glance itself,
proposed here:

https://code.launchpad.net/~gabriel-samfira/simplestreams/+git/simplestreams/+merge/452267

Closes-Bug: #2037542

Change-Id: Ib252a0f62ecdbd619acb95ee2750f780e0654869
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-09-27 16:32:55 +03:00
parent 536540781a
commit e35d07a7cc
No known key found for this signature in database
GPG Key ID: 7D073DCC2C074CB5
1 changed files with 5 additions and 0 deletions

View File

@ -275,6 +275,11 @@ def do_sync(ksc, charm_conf):
"--log-file", SSTREAM_LOG_FILE,
]
if charm_conf['region']:
sync_command += [
"--region", charm_conf['region'],
]
if charm_conf['use_swift']:
sync_command += [
'--output-swift',