From cb7a79bfb6d1e3c7f742996f1ba9109e4ceee3a0 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 17 Apr 2018 13:24:18 -0600 Subject: [PATCH] Enable cleanup by default for undercloud install The goal of this change is to remove the randomly generated data that we we use during the installation of the undercloud by default. This change switches the cleanup configuration in the undercloud.conf to be true by default so we cleanup the generated heat temporary files by default. The undercloud deploy flag still remains the same where it is not currently enabled by default if you leverage the 'openstack undercloud deploy' command. Change-Id: I027a76d2f37a5af5bd0a599783287632298acf3f Related-Bug: #1761810 --- tripleoclient/config/base.py | 8 ++++++-- tripleoclient/tests/v1/undercloud/test_undercloud.py | 12 ++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/tripleoclient/config/base.py b/tripleoclient/config/base.py index 70d8b448c..389ce5e80 100644 --- a/tripleoclient/config/base.py +++ b/tripleoclient/config/base.py @@ -39,8 +39,12 @@ class BaseConfig(object): 'templates, ansible deployment files.'), ), cfg.BoolOpt('cleanup', - default=False, - help=('Cleanup temporary files'), + default=True, + help=('Cleanup temporary files. Setting this to ' + 'False will leave the temporary files used ' + 'during deployment in place after the command ' + 'is run. This is useful for debugging the ' + 'generated files or if errors occur.'), ), ] return self.sort_opts(_opts) diff --git a/tripleoclient/tests/v1/undercloud/test_undercloud.py b/tripleoclient/tests/v1/undercloud/test_undercloud.py index 1585f0a03..37e86905e 100644 --- a/tripleoclient/tests/v1/undercloud/test_undercloud.py +++ b/tripleoclient/tests/v1/undercloud/test_undercloud.py @@ -110,7 +110,7 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/foo', + 'undercloud.yaml', '--output-dir=/foo', '--cleanup', '-e', '/foo/undercloud_parameters.yaml', '--log-file=/tmp/install-undercloud.log']) @@ -267,7 +267,7 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/home/stack', + 'undercloud.yaml', '--output-dir=/home/stack', '--cleanup', '-e', '/home/stack/undercloud_parameters.yaml', '--log-file=/tmp/install-undercloud.log']) @@ -322,7 +322,7 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/home/stack', + 'undercloud.yaml', '--output-dir=/home/stack', '--cleanup', '-e', '/home/stack/undercloud_parameters.yaml', '--debug', '--log-file=/tmp/install-undercloud.log']) @@ -379,7 +379,7 @@ class TestUndercloudInstall(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/home/stack', + 'undercloud.yaml', '--output-dir=/home/stack', '--cleanup', '-e', '/home/stack/undercloud_parameters.yaml', '--log-file=/tmp/install-undercloud.log']) @@ -468,7 +468,7 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/home/stack', + 'undercloud.yaml', '--output-dir=/home/stack', '--cleanup', '-e', '/home/stack/undercloud_parameters.yaml', '--log-file=/tmp/install-undercloud.log']) @@ -526,6 +526,6 @@ class TestUndercloudUpgrade(TestPluginV1): '/usr/share/openstack-tripleo-heat-templates/environments/' 'docker.yaml', '-e', '/usr/share/openstack-tripleo-heat-templates/environments/' - 'undercloud.yaml', '--output-dir=/home/stack', + 'undercloud.yaml', '--output-dir=/home/stack', '--cleanup', '-e', '/home/stack/undercloud_parameters.yaml', '--debug', '--log-file=/tmp/install-undercloud.log'])