Merge "Remove cyclic import between export and utils"

This commit is contained in:
Zuul 2021-07-19 11:47:26 +00:00 committed by Gerrit Code Review
commit a7cae92261
5 changed files with 17 additions and 17 deletions

View File

@ -190,3 +190,15 @@ def export_ceph(stack, cephx,
data['dashboard_enabled'] = False
return data
def export_overcloud(heat, stack, excludes, should_filter,
config_download_dir):
data = export_passwords(heat, stack, excludes)
data.update(export_stack(
heat, stack, should_filter, config_download_dir))
# do not add extra host entries for VIPs for stacks deployed off that
# exported data, since it already contains those entries
data.update({'AddVipsToEtcHosts': False})
data = dict(parameter_defaults=data)
return data

View File

@ -88,6 +88,6 @@ class UtilsFixture(fixtures.Fixture):
'tripleoclient.utils.rm_heat')
).mock
self.mock_export_overcloud = self.useFixture(fixtures.MockPatch(
'tripleoclient.utils.export_overcloud')
'tripleoclient.export.export_overcloud')
).mock
self.mock_export_overcloud.return_value = {}

View File

@ -72,7 +72,6 @@ from tripleo_common.utils import stack as stack_utils
from tripleo_common import update
from tripleoclient import constants
from tripleoclient import exceptions
from tripleoclient import export
from tripleoclient import heat_launcher
from tripleoclient.workflows import roles
@ -2671,18 +2670,6 @@ def get_default_working_dir(stack):
"overcloud-deploy", stack)
def export_overcloud(heat, stack, excludes, should_filter,
config_download_dir):
data = export.export_passwords(heat, stack, excludes)
data.update(export.export_stack(
heat, stack, should_filter, config_download_dir))
# do not add extra host entries for VIPs for stacks deployed off that
# exported data, since it already contains those entries
data.update({'AddVipsToEtcHosts': False})
data = dict(parameter_defaults=data)
return data
def get_ctlplane_attrs():
try:
conn = openstack.connect('undercloud')

View File

@ -36,6 +36,7 @@ from tripleo_common.utils import plan as plan_utils
from tripleoclient import command
from tripleoclient import constants
from tripleoclient import exceptions
from tripleoclient import export
from tripleoclient import utils
from tripleoclient.workflows import deployment
from tripleoclient.workflows import parameters as workflow_params
@ -1223,7 +1224,7 @@ class DeployOvercloud(command.Command):
if (parsed_args.heat_type != 'installed' and
parsed_args.config_download):
# Create overcloud export
data = utils.export_overcloud(
data = export.export_overcloud(
self.orchestration_client,
parsed_args.stack, True, False,
config_download_dir)

View File

@ -19,7 +19,7 @@ from osc_lib.i18n import _
from osc_lib import utils as osc_utils
from tripleoclient import command
from tripleoclient import utils
from tripleoclient import export
class ExportOvercloud(command.Command):
@ -87,7 +87,7 @@ class ExportOvercloud(command.Command):
# prepare clients to access the environment
clients = self.app.client_manager
heat = clients.orchestration
data = utils.export_overcloud(
data = export.export_overcloud(
heat, stack, excludes=not parsed_args.no_password_excludes,
should_filter=False, config_download_dir=config_download_dir)
# write the exported data