mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
fc3f3c90b9
commit
efe5a96725
@ -621,7 +621,7 @@ class xmlclient(Connectible):
|
|||||||
kw['transport'] = KerbTransport()
|
kw['transport'] = KerbTransport()
|
||||||
else:
|
else:
|
||||||
kw['transport'] = LanguageAwareTransport()
|
kw['transport'] = LanguageAwareTransport()
|
||||||
self.log.info('trying %s' % url)
|
self.log.debug('trying %s' % url)
|
||||||
setattr(context, 'request_url', url)
|
setattr(context, 'request_url', url)
|
||||||
serverproxy = ServerProxy(url, **kw)
|
serverproxy = ServerProxy(url, **kw)
|
||||||
if len(urls) == 1:
|
if len(urls) == 1:
|
||||||
@ -697,7 +697,7 @@ class xmlclient(Connectible):
|
|||||||
'%s.forward(): %r not in api.Command' % (self.name, name)
|
'%s.forward(): %r not in api.Command' % (self.name, name)
|
||||||
)
|
)
|
||||||
server = getattr(context, 'request_url', None)
|
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)
|
command = getattr(self.conn, name)
|
||||||
params = [args, kw]
|
params = [args, kw]
|
||||||
try:
|
try:
|
||||||
|
@ -163,7 +163,9 @@ class IpaAdvise(admintool.AdminTool):
|
|||||||
advice.set_options(self.options)
|
advice.set_options(self.options)
|
||||||
|
|
||||||
# Print out the actual advice
|
# Print out the actual advice
|
||||||
|
api.Backend.xmlclient.connect()
|
||||||
advice.get_info()
|
advice.get_info()
|
||||||
|
api.Backend.xmlclient.disconnect()
|
||||||
for line in advice.log.content:
|
for line in advice.log.content:
|
||||||
print line
|
print line
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user