From efd855b04e8c93d3ff14b4ea90e54fe21d7db2c4 Mon Sep 17 00:00:00 2001 From: Michal Minar Date: Thu, 31 Oct 2013 12:36:15 +0100 Subject: 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. --- src/python/lmi/base/BaseConfiguration.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/python/lmi/base/BaseConfiguration.py') 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): """ @@ -198,11 +203,6 @@ class BaseConfiguration(Singleton): """ Return SystemClassName of OpenLMI provider. """ 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. """ -- cgit