Copy the deployment archive to /var/lib/tripleo
Save a copy of the deployment archive to /var/lib/tripleo to avoid accidental deletion by a normal user. Change-Id: I9f5dc697dd1cd7895723d4c23ce89a00631b310f Signed-off-by: James Slagle <jslagle@redhat.com>changes/37/796537/5
parent
10722b5f97
commit
4cf79c5c3a
|
@ -19,6 +19,7 @@ import sys
|
|||
from osc_lib.i18n import _
|
||||
from six.moves import configparser
|
||||
|
||||
TRIPLEO_ARCHIVE_DIR = "/var/lib/tripleo/archive"
|
||||
TRIPLEO_HEAT_TEMPLATES = "/usr/share/openstack-tripleo-heat-templates/"
|
||||
OVERCLOUD_YAML_NAME = "overcloud.yaml"
|
||||
OVERCLOUD_ROLES_FILE = "roles_data.yaml"
|
||||
|
|
|
@ -81,10 +81,17 @@ class TestDeployOvercloud(fakes.TestDeployOvercloud):
|
|||
mock_sleep.start()
|
||||
self.addCleanup(mock_sleep.stop)
|
||||
|
||||
mock_run_command = mock.patch(
|
||||
mock_run_command_and_log = mock.patch(
|
||||
'tripleoclient.utils.run_command_and_log',
|
||||
autospec=True,
|
||||
return_value=0)
|
||||
mock_run_command_and_log.start()
|
||||
self.addCleanup(mock_run_command_and_log.stop)
|
||||
|
||||
mock_run_command = mock.patch(
|
||||
'tripleoclient.utils.run_command',
|
||||
autospec=True,
|
||||
return_value=0)
|
||||
mock_run_command.start()
|
||||
self.addCleanup(mock_run_command.stop)
|
||||
|
||||
|
|
|
@ -2875,3 +2875,16 @@ def run_role_playbooks(self, working_dir, roles_file_dir, roles):
|
|||
# Network Config
|
||||
run_role_playbook(self, inventory, constants.ANSIBLE_TRIPLEO_PLAYBOOKS,
|
||||
'cli-overcloud-node-network-config.yaml')
|
||||
|
||||
|
||||
def create_archive_dir(self, archive_dir=constants.TRIPLEO_ARCHIVE_DIR):
|
||||
"""Create the TripleO archive directory as root. The directory is created
|
||||
in a location typically owned by root (/var/lib), and remains owned as root
|
||||
to decrease the chance it is accidentally deleted by a normal user.
|
||||
|
||||
:param archive_dir: The archive directory to create
|
||||
:type archive_dir: string
|
||||
|
||||
:return: None
|
||||
"""
|
||||
return run_command(['sudo', 'mkdir', '-p', archive_dir])
|
||||
|
|
|
@ -1238,8 +1238,11 @@ class DeployOvercloud(command.Command):
|
|||
ansible_dir = config_download_dir
|
||||
else:
|
||||
ansible_dir = None
|
||||
utils.archive_deploy_artifacts(self.log, parsed_args.stack,
|
||||
self.working_dir, ansible_dir)
|
||||
archive_filename = utils.archive_deploy_artifacts(
|
||||
self.log, parsed_args.stack, self.working_dir, ansible_dir)
|
||||
utils.run_command(
|
||||
['sudo', 'cp', archive_filename,
|
||||
constants.TRIPLEO_ARCHIVE_DIR])
|
||||
except Exception as e:
|
||||
self.log.error('Exception archiving deploy artifacts')
|
||||
self.log.error(e)
|
||||
|
|
Loading…
Reference in New Issue