From 98bfad8578379fcd37388695cb1018ba4022a233 Mon Sep 17 00:00:00 2001
From: Spyros Argyropoulos <spyridon.argyropoulos@cern.ch>
Date: Thu, 14 Jan 2021 15:23:47 +0100
Subject: [PATCH] Fix image selection for 4-digit releases

---
 scripts/generateYaml.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/scripts/generateYaml.py b/scripts/generateYaml.py
index 0665a1a9ae..ce30b274e0 100644
--- a/scripts/generateYaml.py
+++ b/scripts/generateYaml.py
@@ -61,7 +61,7 @@ def getRelease(DSID):
         with open('{DSIDdir}/log.generate.short'.format(DSIDdir=DSID), 'r') as file:
             for line in file.readlines():
                 if "using release" in line:
-                    return int(line.split()[-1].split('-')[-1].replace('.',''))
+                    return line.split()[-1].split('-')[-1]
     else:
         return None
 
@@ -69,7 +69,10 @@ def getRelease(DSID):
 def populateConfig(jobNumber, DSID, rel):
     # Specify which image to use
     if rel is not None:
-        if rel >= 21651:
+        baseRel=int(rel.split('.')[0])
+        majorRel=int(rel.split('.')[1])
+        minorRel=int(rel.split('.')[2])
+        if minorRel >= 51:
             image='atlas/centos7-atlasos'
         else:
             image='atlas/slc6-atlasos'
-- 
GitLab