From 642f769c3ba968d944cf14813058640a2d8d350d Mon Sep 17 00:00:00 2001
From: Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Date: Thu, 28 Jan 2010 14:12:32 +0000
Subject: [PATCH] fixed broken slice-creation

---
 PLC/Methods/GetSliceFamily.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/PLC/Methods/GetSliceFamily.py b/PLC/Methods/GetSliceFamily.py
index 5428ba19..49aee9b3 100644
--- a/PLC/Methods/GetSliceFamily.py
+++ b/PLC/Methods/GetSliceFamily.py
@@ -38,10 +38,6 @@ class GetSliceFamily(Method):
         slice = slices[0]
         slice_id = slice['slice_id']
 
-        # the vref tag, if set, wins
-        vref = GetSliceVref (self.api).call(auth,slice_id)
-        if vref: return vref
-
         arch = GetSliceArch (self.api).call(auth,slice_id)
         if not arch: arch = self.api.config.PLC_FLAVOUR_SLICE_ARCH
 
@@ -51,6 +47,12 @@ class GetSliceFamily(Method):
         fcdistro = GetSliceFcdistro (self.api).call(auth, slice_id)
         if not fcdistro: fcdistro = self.api.config.PLC_FLAVOUR_SLICE_FCDISTRO
 
+        # the vref tag, if set, wins over pldistro
+        vref = GetSliceVref (self.api).call(auth,slice_id)
+
         # xxx would make sense to check the corresponding vserver rpms are available
         # in all node-families yum repos (and yumgroups, btw)
-        return "%s-%s-%s"%(pldistro,fcdistro,arch)
+        if vref: 
+            return "%s-%s-%s"%(vref,fcdistro,arch)
+        else:
+            return "%s-%s-%s"%(pldistro,fcdistro,arch)
-- 
2.47.0