]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-deploy.git/commitdiff
make configparser a runtime dependency
authorKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 08:47:16 +0000 (16:47 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 08:47:18 +0000 (16:47 +0800)
it seems we do need to support duplicated sections, see also
e2df002c22c6542746978d7f15a088a81cf82758, and
ConfigParser.RawConfigParser from python2 does not offer `strict`
parameter, so we have to use configparser as an alternative. otherwise,
`ceph_deploy/tests/test_conf.py::test_section_repeat` always fails

Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph-deploy.spec
ceph_deploy/conf/ceph.py
debian/control
setup.py

index 8218266e407f173a8c2decffcbe81cc69a66a8cb..686613d57c27b40a02a7394c78d523404d71dcd7 100644 (file)
@@ -31,6 +31,7 @@ BuildRequires:  pytest
 %endif
 BuildRequires:  git
 Requires:       python-argparse
+Requires:       python-configparser
 Requires:       python-remoto
 %if 0%{?suse_version} && 0%{?suse_version} <= 1110
 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
index e14ad6d62bf5d0dedf439127307c33dcbe24d3a6..5042404f7fb74df14926a933f77f89f9ba42e1d3 100644 (file)
@@ -1,7 +1,4 @@
-try:
-    import configparser
-except ImportError:
-    import ConfigParser as configparser
+import configparser
 import contextlib
 import sys
 
@@ -21,8 +18,7 @@ class _TrimIndentFile(object):
 
 class CephConf(configparser.RawConfigParser):
     def __init__(self, *args, **kwargs):
-        if sys.version_info >= (3, 2):
-            kwargs.setdefault('strict', False)
+        kwargs.setdefault('strict', False)
         # super() cannot be used with an old-style class
         configparser.RawConfigParser.__init__(self, *args, **kwargs)
 
index ee3c694244a2aad47d01f7a9d6e68673e871a180..d55e43eaafd8f0ef6ab3a4be83a8248f3ad63bef 100644 (file)
@@ -14,6 +14,7 @@ Package: ceph-deploy
 Architecture: all
 Depends: python,
          python-argparse,
+         python-configparser
          python-setuptools,
          python-remoto,
          ${misc:Depends},
index 141f3c4fcfeb2b6d65b8a967736b61e3967cc23d..ce03bd046368540e1e6d8ccc8e1c561deec1b151 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,8 @@ install_requires = ['remoto>=1.1.4']
 pyversion = sys.version_info[:2]
 if pyversion < (2, 7) or (3, 0) <= pyversion <= (3, 1):
     install_requires.append('argparse')
-
+if pyversion < (3, 0):
+    install_requires.append('configparser')
 
 setup(
     name='ceph-deploy',