From 62a1bc23a093e41f5b4ee53f8f2132b6cf583542 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Tue, 9 Mar 2010 11:44:12 +0000 Subject: [PATCH] expose omf-related xmpp settings in getSlivers --- PLC/Methods/GetSlivers.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index 08196b00..ca410efe 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -166,7 +166,11 @@ class GetSlivers(Method): 'tagname': SliceTag.fields['tagname'], 'value': SliceTag.fields['value'] }] - }] + }], + 'xmpp': {'server':Parameter(str,"hostname for the XMPP server"), + 'user':Parameter(str,"username for the XMPP server"), + 'password':Parameter(str,"username for the XMPP server"), + }, } def call(self, auth, node_id_or_hostname = None): @@ -279,6 +283,16 @@ class GetSlivers(Method): node.update_last_contact() + # XMPP config + try: + if not self.api.config.PLC_OMF_ENABLED: + raise Exception,"OMF disabled" + xmpp={'server':self.api.config.PLC_OMF_XMPP_SERVER, + 'user':self.api.config.PLC_OMF_XMPP_USER, + 'password':self.api.config.PLC_OMF_XMPP_PASSWORD, + } + except: + xmpp={'server':None,'user':None,'password':None} return { 'timestamp': timestamp, 'node_id': node['node_id'], @@ -288,5 +302,6 @@ class GetSlivers(Method): 'conf_files': conf_files.values(), 'initscripts': initscripts, 'slivers': slivers, - 'accounts': accounts + 'accounts': accounts, + 'xmpp':xmpp, } -- 2.47.0