frontend: forward command calls using full name

Forward commands to remote server using the full versioned name.

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

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta
2016-06-21 13:06:20 +02:00
parent 8466e94440
commit 5f52e0fcbf

View File

@@ -428,6 +428,10 @@ class Command(HasParam):
def topic(self):
return type(self).__module__.rpartition('.')[2]
@property
def forwarded_name(self):
return self.full_name
def __call__(self, *args, **options):
"""
Perform validation and then execute the command.
@@ -811,7 +815,8 @@ class Command(HasParam):
Forward call over RPC to this same command on server.
"""
try:
return self.Backend.rpcclient.forward(self.name, *args, **kw)
return self.Backend.rpcclient.forward(self.forwarded_name,
*args, **kw)
except errors.RequirementError as e:
if self.api.env.context != 'cli':
raise