diff options
author | Michal Minar <miminar@redhat.com> | 2013-10-31 13:43:02 +0100 |
---|---|---|
committer | Michal Minar <miminar@redhat.com> | 2013-10-31 14:50:36 +0100 |
commit | 8e4f595d6b1861732d39564e9e1b8305d7987beb (patch) | |
tree | 8d266a33e685adda51a106fc3998b229a0d7671d /src/software | |
parent | effab1c1a3b4526680b8a8fac5cd5dbbd3d35ca6 (diff) | |
download | openlmi-providers-8e4f595d6b1861732d39564e9e1b8305d7987beb.tar.gz openlmi-providers-8e4f595d6b1861732d39564e9e1b8305d7987beb.tar.xz openlmi-providers-8e4f595d6b1861732d39564e9e1b8305d7987beb.zip |
software: ditched reference to removed system_name property
system_name property has been removed from BaseConfiguration.
This replaces remaining reference with access to ComputerSystem module.
Silently ignore the first access to get_system_name() when
ComputerSystem instance has not been loaded yet. host property is not
mandatory.
Diffstat (limited to 'src/software')
-rw-r--r-- | src/software/lmi/software/util/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/software/lmi/software/util/__init__.py b/src/software/lmi/software/util/__init__.py index c11a96c..5f601b9 100644 --- a/src/software/lmi/software/util/__init__.py +++ b/src/software/lmi/software/util/__init__.py @@ -28,6 +28,7 @@ import pywbem import re import signal +from lmi.providers import ComputerSystem from lmi.software.util.SoftwareConfiguration \ import SoftwareConfiguration as Configuration @@ -185,8 +186,12 @@ def new_instance_name(class_name, namespace=None, **kwargs): keybindings = pywbem.NocaseDict(kwargs) if namespace is None: namespace = Configuration.get_instance().namespace + try: + host = ComputerSystem.get_system_name() + except ComputerSystem.UninitializedError: + host = None return pywbem.CIMInstanceName( class_name, - host=Configuration.get_instance().system_name, + host=host, namespace=namespace, keybindings=keybindings) |