[python-oslo-config] look for /usr/share/$project/$project-dist.conf by default

Pádraig Brady pbrady at fedoraproject.org
Thu Aug 8 16:14:01 UTC 2013


commit c573f8e49f7d5f03f96398fc5da62cea13653c69
Author: Pádraig Brady <P at draigBrady.com>
Date:   Thu Aug 8 17:11:20 2013 +0100

    look for /usr/share/$project/$project-dist.conf by default

 ...re-project-project-dist.conf-to-the-defau.patch |   42 ++++++++++++++++++++
 python-oslo-config.spec                            |    8 +++-
 2 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/0001-add-usr-share-project-project-dist.conf-to-the-defau.patch b/0001-add-usr-share-project-project-dist.conf-to-the-defau.patch
new file mode 100644
index 0000000..b443016
--- /dev/null
+++ b/0001-add-usr-share-project-project-dist.conf-to-the-defau.patch
@@ -0,0 +1,42 @@
+From 97606faeb64d8d95d66b9c5230611bf9144f2de8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?P=C3=A1draig=20Brady?= <pbrady at redhat.com>
+Date: Mon, 11 Feb 2013 17:32:55 +0000
+Subject: [PATCH] add /usr/share/$project/$project-dist.conf to the default
+ config set
+
+This will lookup /usr/share/$project/$project-dist.conf
+in the correct precedence order by default.
+For example from command line utils which don't specify
+the --config-file option.  Note if daemon init scripts
+explicitly specify a --config-file then they must specify
+all required.
+
+For reference the precedence order is that later --config-file
+options will override settings from previous ones.
+So when no --config-file option is specified, we insert
+the "dist" config file as the first to be parsed,
+and settings from there are overridden by any from
+/etc/$project/$project.conf and /etc/$prog.conf respectively.
+
+For completeness, note settings in configs from --config-dir
+take precedence over any of the --config-file settings above.
+---
+ oslo/config/cfg.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/oslo/config/cfg.py b/oslo/config/cfg.py
+index 7214025..1930c4e 100644
+--- a/oslo/config/cfg.py
++++ b/oslo/config/cfg.py
+@@ -456,6 +456,8 @@ def find_config_files(project=None, prog=None, extension='.conf'):
+ 
+     config_files = []
+     if project:
++        config_files.append(_search_dirs(['/usr/share/%s/' % project],
++                                         project, '-dist%s' % extension))
+         config_files.append(_search_dirs(cfg_dirs, project, extension))
+     config_files.append(_search_dirs(cfg_dirs, prog, extension))
+ 
+-- 
+1.7.11.7
+
diff --git a/python-oslo-config.spec b/python-oslo-config.spec
index 29bf967..f1c7e44 100644
--- a/python-oslo-config.spec
+++ b/python-oslo-config.spec
@@ -4,13 +4,14 @@
 Name:       python-oslo-config
 Epoch:      1
 Version:    1.2.0
-Release:    0.3.%{milestone}%{?dist}
+Release:    0.4.%{milestone}%{?dist}
 Summary:    OpenStack common configuration library
 
 Group:      Development/Languages
 License:    ASL 2.0
 URL:        https://launchpad.net/oslo
 Source0:    http://tarballs.openstack.org/oslo.config/%{sname}-%{version}%{milestone}.tar.gz
+Patch0:     0001-add-usr-share-project-project-dist.conf-to-the-defau.patch
 
 BuildArch:  noarch
 Requires:   python-setuptools
@@ -43,6 +44,8 @@ Documentation for the oslo-config library.
 %prep
 %setup -q -n %{sname}-%{version}%{milestone}
 
+%patch0 -p1
+
 sed -i 's/%{version}%{milestone}/%{version}/' PKG-INFO
 
 # Remove bundled egg-info
@@ -78,6 +81,9 @@ rm -fr doc/build/html/.buildinfo
 %doc LICENSE doc/build/html
 
 %changelog
+* Thu Aug 8 2013 pbrady at redhat.com - 1:1.2.0-0.4.a3
+- Look for /usr/share/$project/$project-dist.conf by default
+
 * Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1:1.2.0-0.3.a3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list