Add cell export to overcloud deploy
Run the equivalent of cell export after the stack is deployed. The difference between overcloud export and cell export is that should_filter=True when running cell export. As either of these exports might be needed later to deploy other stacks, go ahead and make sure both are always run. Change-Id: Idceeb31609533b78034f0b25c4b0fbc6d47c19fb Signed-off-by: James Slagle <jslagle@redhat.com>
This commit is contained in:
parent
ec8e134234
commit
43c2810d65
@ -1395,7 +1395,7 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||||||
0, 12345678, 0,
|
0, 12345678, 0,
|
||||||
1585820526,
|
1585820526,
|
||||||
1585820526,
|
1585820526,
|
||||||
0, 0, 0]):
|
0, 0, 0, 0, 0]):
|
||||||
self.cmd.take_action(parsed_args)
|
self.cmd.take_action(parsed_args)
|
||||||
self.assertIn([
|
self.assertIn([
|
||||||
mock.call(
|
mock.call(
|
||||||
|
@ -582,6 +582,18 @@ class DeployOvercloud(command.Command):
|
|||||||
|
|
||||||
return [output_path]
|
return [output_path]
|
||||||
|
|
||||||
|
def _export_stack(self, parsed_args, should_filter,
|
||||||
|
config_download_dir, export_file):
|
||||||
|
# Create overcloud export
|
||||||
|
data = export.export_overcloud(
|
||||||
|
self.working_dir,
|
||||||
|
parsed_args.stack, True, should_filter,
|
||||||
|
config_download_dir)
|
||||||
|
# write the exported data
|
||||||
|
with open(export_file, 'w') as f:
|
||||||
|
yaml.safe_dump(data, f, default_flow_style=False)
|
||||||
|
os.chmod(export_file, 0o600)
|
||||||
|
|
||||||
def setup_ephemeral_heat(self, parsed_args):
|
def setup_ephemeral_heat(self, parsed_args):
|
||||||
self.log.info("Using ephemeral heat for stack operation")
|
self.log.info("Using ephemeral heat for stack operation")
|
||||||
self.heat_launcher = utils.get_heat_launcher(
|
self.heat_launcher = utils.get_heat_launcher(
|
||||||
@ -1291,16 +1303,19 @@ class DeployOvercloud(command.Command):
|
|||||||
try:
|
try:
|
||||||
if do_stack:
|
if do_stack:
|
||||||
# Create overcloud export
|
# Create overcloud export
|
||||||
data = export.export_overcloud(
|
self._export_stack(
|
||||||
self.working_dir,
|
parsed_args, False,
|
||||||
parsed_args.stack, True, False,
|
config_download_dir,
|
||||||
config_download_dir)
|
os.path.join(
|
||||||
export_file = os.path.join(
|
self.working_dir, "%s-export.yaml" %
|
||||||
self.working_dir, "%s-export.yaml" % parsed_args.stack)
|
parsed_args.stack))
|
||||||
# write the exported data
|
# Create overcloud cell export
|
||||||
with open(export_file, 'w') as f:
|
self._export_stack(
|
||||||
yaml.safe_dump(data, f, default_flow_style=False)
|
parsed_args, True,
|
||||||
os.chmod(export_file, 0o600)
|
config_download_dir,
|
||||||
|
os.path.join(
|
||||||
|
self.working_dir, "%s-cell-export.yaml" %
|
||||||
|
parsed_args.stack))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.log.error('Exception creating overcloud export.')
|
self.log.error('Exception creating overcloud export.')
|
||||||
self.log.error(e)
|
self.log.error(e)
|
||||||
|
Loading…
Reference in New Issue
Block a user