Set config_download_dir for each stack when exporting Ceph

Id8f5b00dd24848f73aeb9794000e0d44f0f9cbe8 introduced the
bug this patch closes because the config_download_dir
path now contains the stack name. In order to export
data from multiple stacks, the config_download_dir path
needs to be set per stack. Thus, move the declaration of
this variable into the for stack in stacks loop.

Closes-Bug: #1922790
Change-Id: I4c4de1cf2a97c87da8ee83074a310656031b788c
This commit is contained in:
John Fulton 2021-04-07 20:36:56 +00:00
parent 446667a851
commit 50afcda1d0
1 changed files with 7 additions and 8 deletions

View File

@ -90,17 +90,16 @@ class ExportOvercloudCeph(command.Command):
raise Exception( raise Exception(
"File '%s' already exists, not exporting." % output_file) "File '%s' already exists, not exporting." % output_file)
if not parsed_args.config_download_dir:
config_download_dir = os.path.join(os.environ.get('HOME'),
"overcloud-deploy",
parsed_args.stack,
'config-download')
else:
config_download_dir = parsed_args.config_download_dir
# extract ceph data for each stack into the cephs list # extract ceph data for each stack into the cephs list
cephs = [] cephs = []
for stack in stacks: for stack in stacks:
if not parsed_args.config_download_dir:
config_download_dir = os.path.join(os.environ.get('HOME'),
"overcloud-deploy",
stack,
'config-download')
else:
config_download_dir = parsed_args.config_download_dir
self.log.info('Exporting Ceph data from stack %s at %s', self.log.info('Exporting Ceph data from stack %s at %s',
stack, self.now) stack, self.now)
cephs.append(export.export_ceph(stack, cephs.append(export.export_ceph(stack,