X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=PLC%2FMethods%2FGetSliceFamily.py;h=910fe2fda61d89cef3d26061e0eacbcead899980;hp=49aee9b306ae6d3bb12287fa40cbb98ee2789821;hb=cf56fea4486cf4c68e763c927f7488b5647bd32d;hpb=642f769c3ba968d944cf14813058640a2d8d350d diff --git a/PLC/Methods/GetSliceFamily.py b/PLC/Methods/GetSliceFamily.py index 49aee9b..910fe2f 100644 --- a/PLC/Methods/GetSliceFamily.py +++ b/PLC/Methods/GetSliceFamily.py @@ -1,12 +1,11 @@ -# $Id$ -# $URL$ from PLC.Method import Method from PLC.Auth import Auth from PLC.Faults import * from PLC.Parameter import * from PLC.Slices import Slice, Slices -from PLC.Accessors.Accessors_standard import * # import slice accessors +from PLC.Accessors.Accessors_standard import * # import slice accessors +from PLC.Accessors.Accessors_sliverauth import * # import slice accessors class GetSliceFamily(Method): """ @@ -27,9 +26,9 @@ class GetSliceFamily(Method): returns = Parameter (str, "the slicefamily this slice should be based upon") - # + # ### system slices - at least planetflow - still rely on 'vref' - # + # def call(self, auth, slice_id_or_name): # Get slice information slices = Slices(self.api, [slice_id_or_name]) @@ -38,21 +37,25 @@ class GetSliceFamily(Method): slice = slices[0] slice_id = slice['slice_id'] - arch = GetSliceArch (self.api).call(auth,slice_id) - if not arch: arch = self.api.config.PLC_FLAVOUR_SLICE_ARCH + # omf-control'ed slivers need the omf vserver reference image + # we used to issue SetSliceVref (self.api) (auth,slice_id,'omf') + # to avoid asking users to set both tags 'omf_control' and 'vref' + # however we can't use SetSliceVref here because a node is only allowed + # to set a sliver tag, not a slice tag + # and this somehow gets called from GetSlivers + # anyways it was a bad idea, let's have the UI do that instead - pldistro = GetSlicePldistro (self.api).call(auth, slice_id) - if not pldistro: pldistro = self.api.config.PLC_FLAVOUR_SLICE_PLDISTRO + # the vref tag, if set, wins over pldistro + pldistro = GetSliceVref(self.api,self.caller).call(auth,slice_id) \ + or GetSlicePldistro (self.api,self.caller).call(auth, slice_id) \ + or self.api.config.PLC_FLAVOUR_SLICE_PLDISTRO - fcdistro = GetSliceFcdistro (self.api).call(auth, slice_id) - if not fcdistro: fcdistro = self.api.config.PLC_FLAVOUR_SLICE_FCDISTRO + fcdistro = GetSliceFcdistro (self.api,self.caller).call(auth, slice_id) \ + or self.api.config.PLC_FLAVOUR_SLICE_FCDISTRO - # the vref tag, if set, wins over pldistro - vref = GetSliceVref (self.api).call(auth,slice_id) + arch = GetSliceArch (self.api,self.caller).call(auth,slice_id) \ + or self.api.config.PLC_FLAVOUR_SLICE_ARCH # xxx would make sense to check the corresponding vserver rpms are available # in all node-families yum repos (and yumgroups, btw) - if vref: - return "%s-%s-%s"%(vref,fcdistro,arch) - else: - return "%s-%s-%s"%(pldistro,fcdistro,arch) + return "%s-%s-%s"%(pldistro,fcdistro,arch)