Repository :
http://git.fedorahosted.org/cgit/cura-tools.git
On branch : master
---------------------------------------------------------------
commit fff82781663bfe383b774e4fc3864418257f0786
Author: Peter Hatina <phatina(a)redhat.com>
Date: Wed Mar 13 14:34:07 2013 +0100
add nonexisting class check
---------------------------------------------------------------
cli-tools/lmi/lmi_client_shell.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/cli-tools/lmi/lmi_client_shell.py b/cli-tools/lmi/lmi_client_shell.py
index 986375e..1aa593e 100644
--- a/cli-tools/lmi/lmi_client_shell.py
+++ b/cli-tools/lmi/lmi_client_shell.py
@@ -398,7 +398,9 @@ class _LmiNamespace(BaseObject):
self._name = name
def __getattr__(self, name):
- # TODO: check class existance, otherwise return None
+ (class_list, _, _) = self._client._get_class_names(self._name, DeepInheritance =
True)
+ if not class_list or not name in class_list:
+ return None
return _LmiClass(self._client, self, name)
def __repr__(self):