diff options
| author | Michal Minar <miminar@redhat.com> | 2013-10-31 12:36:15 +0100 |
|---|---|---|
| committer | Michal Minar <miminar@redhat.com> | 2013-10-31 13:24:02 +0100 |
| commit | efd855b04e8c93d3ff14b4ea90e54fe21d7db2c4 (patch) | |
| tree | b3243957f05b89c556f776719cb6f37d26a4d6fc /src/python/lmi/base/BaseConfiguration.py | |
| parent | e639b9b9129562fbe9568d07a2c63f8437dbf48b (diff) | |
| download | openlmi-providers-efd855b04e8c93d3ff14b4ea90e54fe21d7db2c4.tar.gz openlmi-providers-efd855b04e8c93d3ff14b4ea90e54fe21d7db2c4.tar.xz openlmi-providers-efd855b04e8c93d3ff14b4ea90e54fe21d7db2c4.zip | |
python: solve ComputerSystem issues
Added ComputerSystem module to lmi.providers with convenience functions
allowing to obtain instance from CIMOM and check for its correctness
when inspecting client's input.
Also removed obsoleted system_name property out of BaseConfiguration
class.
Diffstat (limited to 'src/python/lmi/base/BaseConfiguration.py')
| -rw-r--r-- | src/python/lmi/base/BaseConfiguration.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/python/lmi/base/BaseConfiguration.py b/src/python/lmi/base/BaseConfiguration.py index 8333cca..baabcc6 100644 --- a/src/python/lmi/base/BaseConfiguration.py +++ b/src/python/lmi/base/BaseConfiguration.py @@ -72,6 +72,10 @@ class BaseConfiguration(Singleton): There should be only one instance of this class. """ + #: Allow to access global configuration object also from lmi.providers + #: subpackage where ``get_instance()`` can not be used. + #: This variable shall be set in ``__init__()`` method. + INSTANCE = None CONFIG_DIRECTORY_TEMPLATE_TOPLEVEL = '/etc/openlmi/' CONFIG_DIRECTORY_TEMPLATE_PROVIDER = '/etc/openlmi/%(provider_prefix)s/' CONFIG_FILE_PATH_TEMPLATE_TOPLEVEL = \ @@ -152,6 +156,7 @@ class BaseConfiguration(Singleton): self.config = ConfigParser.SafeConfigParser( defaults=self.default_options()) self.load() + BaseConfiguration.INSTANCE = self def add_listener(self, callback): """ @@ -199,11 +204,6 @@ class BaseConfiguration(Singleton): return self.config.get('CIM', 'SystemClassName') @property - def system_name(self): - """ Return SystemName of OpenLMI provider. """ - return socket.getfqdn() - - @property def logging_level(self): """ Return name of logging level in lower case. """ return self.config.get('Log', 'Level').lower() |
