From 32d993bbf04677078ddf682e0372a096e2bc5504 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Wed, 9 May 2018 16:03:56 -0500 Subject: [PATCH] Trim whitespace in multi-line env descriptions Indenting blank description lines just creates unnecessary trailing whitespace in the output file. Skip the indentation in this case. Change-Id: Ib0fbd26b489f6d9cf262c1186d3b3e604d4c0c67 --- environments/enable-designate.yaml | 2 +- environments/standalone/standalone-overcloud.yaml | 4 ++-- environments/standalone/standalone-tripleo.yaml | 4 ++-- tripleo_heat_templates/environment_generator.py | 5 ++++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/environments/enable-designate.yaml b/environments/enable-designate.yaml index 94a5f1cf40..9cfcc7b6ad 100644 --- a/environments/enable-designate.yaml +++ b/environments/enable-designate.yaml @@ -8,7 +8,7 @@ # description: | # EXPERIMENTAL: This service is not considered ready for production and # should only be used for development and test purposes at this time. -# +# # This environment enables the Designate services. One of the # designate-config* environment files must also be included. resource_registry: diff --git a/environments/standalone/standalone-overcloud.yaml b/environments/standalone/standalone-overcloud.yaml index 6cbdc6461e..de10e160ea 100644 --- a/environments/standalone/standalone-overcloud.yaml +++ b/environments/standalone/standalone-overcloud.yaml @@ -8,7 +8,7 @@ # description: | # A Heat environment that can be used to deploy a single node all-in-one # node via an Undercloud using the normal Overcloud deployment process. -# +# # By default we only want the following OpenStack services to be enabled: # * Keystone # * Nova (and related) @@ -19,7 +19,7 @@ # * Horizon # This file disables any other OpenStack services that would normally be # enabled. -# +# # openstack overcloud roles generate -o ~/roles_data.yaml Standalone parameter_defaults: # DNS servers to use for the Overcloud (2 max for some implementations). If not set the nameservers configured in the ctlplane subnet's dns_nameservers attribute will be used. diff --git a/environments/standalone/standalone-tripleo.yaml b/environments/standalone/standalone-tripleo.yaml index 4542ee44d9..d99eec18d0 100644 --- a/environments/standalone/standalone-tripleo.yaml +++ b/environments/standalone/standalone-tripleo.yaml @@ -10,7 +10,7 @@ # node via the 'overcloud tripleo deploy' command. This does not # require an Undercloud for the deployment and can be used to deploy # a single node on the local machine. -# +# # By default we only want the following OpenStack services to be enabled: # * Keystone # * Nova (and related) @@ -21,7 +21,7 @@ # * Horizon # This file disables any other OpenStack services that would normally be # enabled. -# +# # openstack overcloud roles generate -o ~/roles_data.yaml Standalone parameter_defaults: # Set to true to append per network Vips to /etc/hosts on each node. diff --git a/tripleo_heat_templates/environment_generator.py b/tripleo_heat_templates/environment_generator.py index 818e74b851..6fbf87ad19 100755 --- a/tripleo_heat_templates/environment_generator.py +++ b/tripleo_heat_templates/environment_generator.py @@ -181,7 +181,10 @@ def _generate_environment(input_env, output_path, parent_env=None): env_desc = env.get('description', '') env_file.write(u'# description: |\n') for line in env_desc.splitlines(): - env_file.write(u'# %s\n' % line) + if line: + env_file.write(u'# %s\n' % line) + else: + env_file.write('#\n') if parameter_defaults or static_defaults: env_file.write(u'parameter_defaults:\n') write_params_entry(env_file, parameter_defaults[_PARAMETERS],