Enable running API commands in ipa-advise plugins

https://fedorahosted.org/freeipa/ticket/3671
https://fedorahosted.org/freeipa/ticket/3672
This commit is contained in:
Ana Krivokapic 2013-08-02 16:11:16 +02:00 committed by Martin Kosek
parent fc3f3c90b9
commit efe5a96725
2 changed files with 4 additions and 2 deletions

View File

@ -621,7 +621,7 @@ class xmlclient(Connectible):
kw['transport'] = KerbTransport()
else:
kw['transport'] = LanguageAwareTransport()
self.log.info('trying %s' % url)
self.log.debug('trying %s' % url)
setattr(context, 'request_url', url)
serverproxy = ServerProxy(url, **kw)
if len(urls) == 1:
@ -697,7 +697,7 @@ class xmlclient(Connectible):
'%s.forward(): %r not in api.Command' % (self.name, name)
)
server = getattr(context, 'request_url', None)
self.info("Forwarding '%s' to server '%s'", name, server)
self.debug("Forwarding '%s' to server '%s'", name, server)
command = getattr(self.conn, name)
params = [args, kw]
try:

View File

@ -163,7 +163,9 @@ class IpaAdvise(admintool.AdminTool):
advice.set_options(self.options)
# Print out the actual advice
api.Backend.xmlclient.connect()
advice.get_info()
api.Backend.xmlclient.disconnect()
for line in advice.log.content:
print line