python-linstor 1.21.0__tar.gz → 1.27.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {python-linstor-1.21.0/python_linstor.egg-info → python_linstor-1.27.1}/PKG-INFO +16 -11
  2. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/config.py +25 -14
  3. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/linstorapi.py +663 -608
  4. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/properties.py +211 -201
  5. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/resource.py +29 -2
  6. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/resourcegroup.py +18 -0
  7. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/responses.py +113 -234
  8. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/sharedconsts.py +56 -54
  9. python_linstor-1.27.1/linstor/version.py +1 -0
  10. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/consts.json +196 -218
  11. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/genproperties.py +22 -1
  12. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/properties.json +168 -216
  13. python_linstor-1.27.1/linstor_tests/test_linstorapi.py +36 -0
  14. python_linstor-1.27.1/pyproject.toml +40 -0
  15. {python-linstor-1.21.0 → python_linstor-1.27.1/python_linstor.egg-info}/PKG-INFO +16 -11
  16. {python-linstor-1.21.0 → python_linstor-1.27.1}/python_linstor.egg-info/SOURCES.txt +2 -1
  17. {python-linstor-1.21.0 → python_linstor-1.27.1}/setup.py +2 -60
  18. python-linstor-1.21.0/linstor/version.py +0 -1
  19. python-linstor-1.21.0/python_linstor.egg-info/requires.txt +0 -3
  20. {python-linstor-1.21.0 → python_linstor-1.27.1}/COPYING +0 -0
  21. {python-linstor-1.21.0 → python_linstor-1.27.1}/MANIFEST.in +0 -0
  22. {python-linstor-1.21.0 → python_linstor-1.27.1}/Makefile +0 -0
  23. {python-linstor-1.21.0 → python_linstor-1.27.1}/README.md +0 -0
  24. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/__init__.py +0 -0
  25. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/errors.py +0 -0
  26. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/kv.py +0 -0
  27. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor/size_calc.py +0 -0
  28. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/Makefile +0 -0
  29. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/drbdoptions.json +0 -0
  30. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/drbdsetup.xml +0 -0
  31. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/genconsts.py +0 -0
  32. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor-common/gendrbdoptions.py +0 -0
  33. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor_tests/__init__.py +0 -0
  34. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor_tests/test_responses.py +0 -0
  35. {python-linstor-1.21.0 → python_linstor-1.27.1}/linstor_tests/test_utils.py +0 -0
  36. {python-linstor-1.21.0 → python_linstor-1.27.1}/python_linstor.egg-info/dependency_links.txt +0 -0
  37. {python-linstor-1.21.0 → python_linstor-1.27.1}/python_linstor.egg-info/top_level.txt +0 -0
  38. {python-linstor-1.21.0 → python_linstor-1.27.1}/setup.cfg +0 -0
  39. {python-linstor-1.21.0 → python_linstor-1.27.1}/setup.cfg.py2 +0 -0
@@ -1,27 +1,32 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: python-linstor
3
- Version: 1.21.0
3
+ Version: 1.27.1
4
4
  Summary: Linstor python api
5
5
  Home-page: https://www.linbit.com
6
- Author: Robert Altnoeder <robert.altnoeder@linbit.com>, Roland Kammerer <roland.kammerer@linbit.com>, Rene Peinthor <rene.peinthor@linbit.com>, Moritz Wanzenboeck <moritz.wanzenboeck@linbit.com>
7
- Author-email: rene.peinthor@linbit.com
8
- Maintainer: LINBIT HA-Solutions GmbH
9
- Maintainer-email: drbd-user@lists.linbit.com
10
- License: LGPLv3
11
- Project-URL: Source Code, https://github.com/LINBIT/linstor-api-py
12
- Project-URL: Documentation, https://linbit.github.io/linstor-api-py
6
+ Author-email: Rene Peinthor <rene.peinthor@linbit.com>, Roland Kammerer <roland.kammerer@linbit.com>, Gabor Hernadi <gabor.hernadi@linbit.com>, Moritz Wanzenboeck <moritz.wanzenboeck@linbit.com>
7
+ Maintainer-email: Rene Peinthor <rene.peinthor@linbit.com>
8
+ License-Expression: LGPL-3.0-or-later
9
+ Project-URL: Homepage, https://github.com/LINBIT/linstor-api-py
10
+ Project-URL: Documentation, https://linbit.github.io/linstor-api-py/
11
+ Project-URL: Repository, https://github.com/LINBIT/linstor-api-py.git
12
+ Project-URL: Issues, https://github.com/LINBIT/linstor-api-py/issues
13
+ Project-URL: Changelog, https://github.com/LINBIT/linstor-api-py/blob/master/CHANGELOG.md
13
14
  Classifier: Development Status :: 5 - Production/Stable
14
15
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)
16
16
  Classifier: Programming Language :: Python :: 2.7
17
17
  Classifier: Programming Language :: Python :: 3.5
18
18
  Classifier: Programming Language :: Python :: 3.6
19
19
  Classifier: Programming Language :: Python :: 3.7
20
20
  Classifier: Programming Language :: Python :: 3.8
21
21
  Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Programming Language :: Python :: 3.12
25
+ Requires-Python: >=3.5
22
26
  Description-Content-Type: text/markdown
23
27
  License-File: COPYING
24
- Requires-Dist: enum34; python_version < "3"
28
+ Dynamic: home-page
29
+ Dynamic: license-file
25
30
 
26
31
  # LINSTOR Python API
27
32
 
@@ -9,6 +9,8 @@ except ImportError:
9
9
 
10
10
 
11
11
  class Config(object):
12
+ CONFIG = None # cache object
13
+
12
14
  @staticmethod
13
15
  def read_config(config_file):
14
16
  cp = ConfigParser()
@@ -20,20 +22,29 @@ class Config(object):
20
22
 
21
23
  @staticmethod
22
24
  def get_section(section, config_file_name=None):
23
- home_dir = os.path.expanduser("~")
24
- config_file = "linstor-client.conf"
25
- user_conf = os.path.join(home_dir, ".config", "linstor", config_file)
26
- sys_conf = os.path.join('/etc', 'linstor', config_file)
27
-
28
- config = None
29
- if config_file_name and os.path.exists(config_file_name):
30
- config = Config.read_config(config_file_name)
31
- elif os.path.exists(user_conf):
32
- config = Config.read_config(user_conf)
33
- elif os.path.exists(sys_conf):
34
- config = Config.read_config(sys_conf)
35
-
36
- entries = config.get(section, []) if config else []
25
+ if Config.CONFIG is None:
26
+ home_dir = os.path.expanduser("~")
27
+ config_file = "linstor-client.conf"
28
+ user_conf = os.path.join(home_dir, ".config", "linstor", config_file)
29
+ sys_conf = os.path.join('/etc', 'linstor', config_file)
30
+ sys_d_conf_dir = os.path.join('/etc', 'linstor', 'linstor-client.d')
31
+
32
+ config = {}
33
+ if os.path.exists(sys_d_conf_dir):
34
+ conf_files = [x for x in os.listdir(sys_d_conf_dir) if x.endswith('.conf')]
35
+ conf_files.sort()
36
+ for file in conf_files:
37
+ config.update(Config.read_config(os.path.join(sys_d_conf_dir, file)))
38
+
39
+ if config_file_name and os.path.exists(config_file_name):
40
+ config.update(Config.read_config(config_file_name))
41
+ elif os.path.exists(user_conf):
42
+ config.update(Config.read_config(user_conf))
43
+ elif os.path.exists(sys_conf):
44
+ config.update(Config.read_config(sys_conf))
45
+ Config.CONFIG = config
46
+
47
+ entries = Config.CONFIG.get(section, []) if Config.CONFIG else []
37
48
  return {k: v for k, v in entries}
38
49
 
39
50
  @staticmethod