[openstack-glance] update the default config in a more consistent and maintainable way

Pádraig Brady pbrady at fedoraproject.org
Tue May 22 01:50:16 UTC 2012


commit 1b2196cc95a12952cae9433a486d514b58a247bf
Author: Pádraig Brady <P at draigBrady.com>
Date:   Tue May 22 02:24:36 2012 +0100

    update the default config in a more consistent and maintainable way
    
    Note I run openstack-config in the 'build' rather than the 'prep',
    so that one can run prep independently of BuildRequires.

 glance-registry.conf  |   65 -------------------------------------------------
 openstack-glance.spec |   11 +++++---
 2 files changed, 7 insertions(+), 69 deletions(-)
---
diff --git a/openstack-glance.spec b/openstack-glance.spec
index 5173313..51a7338 100644
--- a/openstack-glance.spec
+++ b/openstack-glance.spec
@@ -10,7 +10,6 @@ Source0:          https://launchpad.net/glance/essex/2012.1/+download/glance-%{v
 Source1:          openstack-glance-api.service
 Source2:          openstack-glance-registry.service
 Source3:          openstack-glance.logrotate
-Source5:          glance-registry.conf
 
 #
 # patches_base=2012.1
@@ -34,6 +33,7 @@ Requires(postun): systemd-units
 Requires(pre):    shadow-utils
 Requires:         python-glance = %{version}-%{release}
 Requires:         openstack-utils
+BuildRequires:    openstack-utils
 
 %description
 OpenStack Image Service (code-named Glance) provides discovery, registration,
@@ -105,11 +105,14 @@ This package contains documentation files for glance.
 %patch0006 -p1
 %patch0007 -p1
 
-sed -i 's|\(sql_connection = \)sqlite:///glance.sqlite|\1mysql://glance:glance@localhost/glance|' etc/glance-registry.conf
-
 sed -i '/\/usr\/bin\/env python/d' glance/common/config.py glance/registry/db/migrate_repo/manage.py
 
 %build
+
+# Change the default config
+openstack-config --set etc/glance-registry.conf DEFAULT sql_connection mysql://glance:glance@localhost/glance
+openstack-config --set etc/glance-registry.conf DEFAULT db_auto_create False
+
 %{__python} setup.py build
 
 %install
@@ -142,7 +145,7 @@ install -d -m 755 %{buildroot}%{_sharedstatedir}/glance/images
 install -p -D -m 644 etc/glance-api.conf %{buildroot}%{_sysconfdir}/glance/glance-api.conf
 install -p -D -m 644 etc/glance-api-paste.ini %{buildroot}%{_sysconfdir}/glance/glance-api-paste.ini
 # glance-registry.conf contains a db password
-install -p -D -m 640 %{SOURCE5} %{buildroot}%{_sysconfdir}/glance/glance-registry.conf
+install -p -D -m 640 etc/glance-registry.conf %{buildroot}%{_sysconfdir}/glance/glance-registry.conf
 install -p -D -m 644 etc/glance-registry-paste.ini %{buildroot}%{_sysconfdir}/glance/glance-registry-paste.ini
 install -p -D -m 644 etc/glance-cache.conf %{buildroot}%{_sysconfdir}/glance/glance-cache.conf
 install -p -D -m 644 etc/glance-cache-paste.ini %{buildroot}%{_sysconfdir}/glance/glance-cache-paste.ini


More information about the scm-commits mailing list