cb7a79bfb6
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
51 lines
1.8 KiB
Python
51 lines
1.8 KiB
Python
# Copyright 2018 Red Hat, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
#
|
|
|
|
from oslo_config import cfg
|
|
from tripleoclient import constants
|
|
|
|
|
|
class BaseConfig(object):
|
|
|
|
def sort_opts(self, opts):
|
|
"""Sort oslo config options by name
|
|
|
|
:param opts: list of olo cfg opts
|
|
:return list - sorted by name
|
|
"""
|
|
def sort_cfg(cfg):
|
|
return cfg.name
|
|
return sorted(opts, key=sort_cfg)
|
|
|
|
def get_base_opts(self):
|
|
_opts = [
|
|
# TODO(aschultz): rename undercloud_output_dir
|
|
cfg.StrOpt('output_dir',
|
|
default=constants.UNDERCLOUD_OUTPUT_DIR,
|
|
help=(
|
|
'Directory to output state, processed heat '
|
|
'templates, ansible deployment files.'),
|
|
),
|
|
cfg.BoolOpt('cleanup',
|
|
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)
|