From 41d453c7452e78c4521f3b887d30518225b4b6d3 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Wed, 10 Mar 2010 15:51:51 +0000 Subject: [PATCH] change the way 'vref' gets set on omf-control'ed slivers --- PLC/Methods/GetSliceFamily.py | 7 +++++++ PLC/Methods/GetSlivers.py | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PLC/Methods/GetSliceFamily.py b/PLC/Methods/GetSliceFamily.py index 49aee9b..512cbb1 100644 --- a/PLC/Methods/GetSliceFamily.py +++ b/PLC/Methods/GetSliceFamily.py @@ -7,6 +7,7 @@ from PLC.Parameter import * from PLC.Slices import Slice, Slices from PLC.Accessors.Accessors_standard import * # import slice accessors +from PLC.Accessors.Accessors_omf import * # import slice accessors class GetSliceFamily(Method): """ @@ -50,6 +51,12 @@ class GetSliceFamily(Method): # the vref tag, if set, wins over pldistro vref = GetSliceVref (self.api).call(auth,slice_id) + # omf-control'ed slivers need the omf vserver reference image + # this is to avoid asking users to set both tags 'omf_control' and 'vref' + if not vref and GetSliceOmfControl(self.api).call(auth,slice_id): + SetSliceVref (self.api) (auth,slice_id,'omf') + vref='omf' + # xxx would make sense to check the corresponding vserver rpms are available # in all node-families yum repos (and yumgroups, btw) if vref: diff --git a/PLC/Methods/GetSlivers.py b/PLC/Methods/GetSlivers.py index ca410ef..2d201b9 100644 --- a/PLC/Methods/GetSlivers.py +++ b/PLC/Methods/GetSlivers.py @@ -283,7 +283,7 @@ class GetSlivers(Method): node.update_last_contact() - # XMPP config + # XMPP config for omf federation try: if not self.api.config.PLC_OMF_ENABLED: raise Exception,"OMF disabled" @@ -293,6 +293,7 @@ class GetSlivers(Method): } except: xmpp={'server':None,'user':None,'password':None} + return { 'timestamp': timestamp, 'node_id': node['node_id'], -- 2.43.0