[openstack-heat/el6-icehouse] avoid [keystone_authtoken] config corruption in heat.conf

Pádraig Brady pbrady at fedoraproject.org
Tue Jan 7 00:56:49 UTC 2014


commit a6a49a9997c387e61bc6858bc1da3ea0a87d92ca
Author: Pádraig Brady <P at draigBrady.com>
Date:   Tue Jan 7 00:40:39 2014 +0000

    avoid [keystone_authtoken] config corruption in heat.conf
    
    Icehouse now mimics what Red Hat distro config has done for ages
    and puts the keystone_authtoken _config_ in the heat _config_ file,
    rather than in the api-paste.ini.
    
    However the way it did it conflicted with our modifications to heat.conf
    resulting in duplicate sections.  This in turn triggered a bug in the
    puppet ini editing code that resulted in lines just containint "nil"
    to be inserted, which then resulted in parsing failure in puppet and
    failure to install in packstack/foreman.
    
    Resolves: rhbz#1047156

 openstack-heat.spec |   48 +++++++++++++-----------------------------------
 1 files changed, 13 insertions(+), 35 deletions(-)
---
diff --git a/openstack-heat.spec b/openstack-heat.spec
index 947254d..ce0bdea 100644
--- a/openstack-heat.spec
+++ b/openstack-heat.spec
@@ -88,44 +88,19 @@ sed -i s/REDHATHEATRELEASE/%{release}/ heat/version.py
 # to distutils requires_dist config
 rm -rf {test-,}requirements.txt tools/{pip,test}-requires
 
-echo '
-#
-# Options to be passed to keystoneclient.auth_token middleware
-# NOTE: These options are not defined in heat but in keystoneclient
-#
-[keystone_authtoken]
-
-# the name of the admin tenant (string value)
-#admin_tenant_name=
-
-# the keystone admin username (string value)
-#admin_user=
-
-# the keystone admin password (string value)
-#admin_password=
-
-# the keystone host (string value)
-#auth_host=
-
-# the keystone port (integer value)
-#auth_port=
-
-# protocol to be used for auth requests http/https (string value)
-#auth_protocol=
-
-#auth_uri=
-
-# signing_dir is configurable, but the default behavior of the authtoken
-# middleware should be sufficient.  It will create a temporary directory
-# in the home directory for the user the heat process is running as.
-#signing_dir=/var/lib/heat/keystone-signing
-' >> etc/heat/heat.conf.sample
 
 # Programmatically update defaults in sample config
 # which is installed at /etc/heat/heat.conf
-# TODO: Make this more robust
-# Note it only edits the first occurance, so assumes a section ordering in sample
-# and also doesn't support multi-valued variables.
+
+#  First we ensure all values are commented in appropriate format.
+#  Since icehouse, there was an uncommented keystone_authtoken section
+#  at the end of the file which mimics but also conflicted with our
+#  distro editing that had been done for many releases.
+sed -i '/^[^#[]/{s/^/#/; s/ //g}; /^#[^ ]/s/ = /=/' etc/heat/heat.conf.sample
+
+#  TODO: Make this more robust
+#  Note it only edits the first occurance, so assumes a section ordering in sample
+#  and also doesn't support multi-valued variables.
 while read name eq value; do
   test "$name" && test "$value" || continue
   sed -i "0,/^# *$name=/{s!^# *$name=.*!#$name=$value!}" etc/heat/heat.conf.sample
@@ -409,6 +384,9 @@ fi
 
 
 %changelog
+* Mon Jan 06 2014 Pádraig Brady <pbrady at redhat.com> - 2014.1-0.4.b1
+- Avoid [keystone_authtoken] config corruption in heat.conf
+
 * Mon Jan 06 2014 Jeff Peeler <jpeeler at redhat.com> 2014-1.0.4.b1
 - added MySQL-python requires
 - removed heat-db-setup (rhbz 1046326)


More information about the scm-commits mailing list