Fall back to alt path for ceph client data during export

The patch to fix the related bug (not this patch) fixes an
inconsistency where the ceph client data is somtimes exported
to the wrong path. If anyone deployed before they got the fix
to the related bug, then this patch will workaround that
problem if they export later.

When 'openstack overcloud export ceph' is run look in the
correct default location for the ceph client data and if it
is not found, then fall back to incorrect location.

Change-Id: I0b8c747481e561645eefea50cb77ca806a7f0de2
Related-Bug: #1978846
(cherry picked from commit fda3233451)
This commit is contained in:
John Fulton 2022-06-17 16:11:59 -04:00
parent 3cb4bdac8f
commit 7af5a55c81

View File

@ -212,6 +212,9 @@ def export_ceph(stack, cephx,
if 'cephadm' in config_download_files:
ceph_client = "cephadm/ceph_client.yml"
file = os.path.join(config_download_dir, stack, ceph_client)
if not os.path.exists(file):
# fall back to old path if user had LP 1978846 during deployment
file = "/home/stack/ceph_client.yaml"
with open(file, 'r') as ff:
ceph_data = yaml.safe_load(ff)