From 50afcda1d0180b2848b5a7345ae775eb8cf6fd50 Mon Sep 17 00:00:00 2001 From: John Fulton Date: Wed, 7 Apr 2021 20:36:56 +0000 Subject: [PATCH] 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 --- tripleoclient/v1/overcloud_export_ceph.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tripleoclient/v1/overcloud_export_ceph.py b/tripleoclient/v1/overcloud_export_ceph.py index bad53a721..3a4351c0a 100644 --- a/tripleoclient/v1/overcloud_export_ceph.py +++ b/tripleoclient/v1/overcloud_export_ceph.py @@ -90,17 +90,16 @@ class ExportOvercloudCeph(command.Command): raise Exception( "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 cephs = [] 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', stack, self.now) cephs.append(export.export_ceph(stack,