client: do not crash when overriding remote command as method

Do not crash during API initialization when overriding remote command that
is not a method with MethodOverride.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-30 15:45:54 +02:00
parent e5635f7ef4
commit cf713ac283
2 changed files with 21 additions and 8 deletions

View File

@@ -55,11 +55,17 @@ class CommandOverride(Command):
class MethodOverride(CommandOverride, Method):
@property
def obj_name(self):
return self.next.obj_name
try:
return self.next.obj_name
except AttributeError:
return None
@property
def attr_name(self):
return self.next.attr_name
try:
return self.next.attr_name
except AttributeError:
return None
@property
def obj(self):