From aee4a5354abde7ae9363053bce1a7117a8ed7b5e Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Fri, 28 Jan 2011 09:40:56 +0100 Subject: [PATCH] protect GetSlivers against possible failure --- PLC/Methods/GetSliceFamily.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PLC/Methods/GetSliceFamily.py b/PLC/Methods/GetSliceFamily.py index 48b3f224..79bcdd49 100644 --- a/PLC/Methods/GetSliceFamily.py +++ b/PLC/Methods/GetSliceFamily.py @@ -51,9 +51,12 @@ class GetSliceFamily(Method): # 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,self.caller).call(auth,slice_id): - SetSliceVref (self.api) (auth,slice_id,'omf') - vref='omf' + # protect against failure + try: + if not vref and GetSliceOmfControl(self.api,self.caller).call(auth,slice_id): + SetSliceVref (self.api) (auth,slice_id,'omf') + vref='omf' + except: pass # xxx would make sense to check the corresponding vserver rpms are available # in all node-families yum repos (and yumgroups, btw) -- 2.45.2