Preserve roles_data and network_data
This will make sure that we keep existing roles_data and network_data
during a plan update, unless the user has passed in new files on the
command line.
Partial-Bug: #1749700
Change-Id: Ic059f50f0b2a3a2b20011851cb0b1576192c0d00
(cherry picked from commit 8e715b9dea
)
This commit is contained in:
parent
9001864946
commit
e8e1484fe7
|
@ -237,6 +237,8 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
[
|
||||
{'name': 'plan-environment.yaml'},
|
||||
{'name': 'user-environment.yaml'},
|
||||
{'name': 'roles_data.yaml'},
|
||||
{'name': 'network_data.yaml'},
|
||||
]
|
||||
)
|
||||
|
||||
|
@ -275,6 +277,10 @@ class TestPlanUpdateWorkflows(base.TestCommand):
|
|||
'plan-environment.yaml: mock content\n'),
|
||||
mock.call('test-overcloud', 'user-environment.yaml',
|
||||
'user-environment.yaml: mock content\n'),
|
||||
mock.call('test-overcloud', 'roles_data.yaml',
|
||||
'roles_data.yaml: mock content\n'),
|
||||
mock.call('test-overcloud', 'network_data.yaml',
|
||||
'network_data.yaml: mock content\n'),
|
||||
],
|
||||
any_order=True,
|
||||
)
|
||||
|
|
|
@ -157,6 +157,8 @@ def update_plan_from_templates(clients, name, tht_root, roles_file=None,
|
|||
{
|
||||
constants.PLAN_ENVIRONMENT: plan_env_file,
|
||||
constants.USER_ENVIRONMENT: None,
|
||||
constants.OVERCLOUD_ROLES_FILE: roles_file,
|
||||
constants.OVERCLOUD_NETWORKS_FILE: networks_file,
|
||||
}
|
||||
)
|
||||
elif not plan_env_file:
|
||||
|
@ -180,8 +182,7 @@ def update_plan_from_templates(clients, name, tht_root, roles_file=None,
|
|||
|
||||
print("Uploading new plan files")
|
||||
if keep_env:
|
||||
_upload_templates(swift_client, name, tht_root, roles_file=roles_file,
|
||||
plan_env_file=None, networks_file=networks_file)
|
||||
_upload_templates(swift_client, name, tht_root)
|
||||
for filename in keep_file_contents:
|
||||
_upload_file_content(swift_client, name, filename,
|
||||
keep_file_contents[filename])
|
||||
|
|
Loading…
Reference in New Issue