From 4d7111708088eeeeb9b2d558f490dfccee21e538 Mon Sep 17 00:00:00 2001 From: Mario Melara Date: Mon, 20 May 2019 11:06:02 -0700 Subject: Get Cray OS version from PrgEnv-cray (#10774) The regex used for finding the Cray OS version from the PrgEnv-cray module was not exact and was at times pulling the version from other PrgEnv modules. This updates the regular expression to be more exact. --- lib/spack/spack/operating_systems/cnl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/spack/spack/operating_systems/cnl.py b/lib/spack/spack/operating_systems/cnl.py index 7d21d6ef86..59b6e980a2 100644 --- a/lib/spack/spack/operating_systems/cnl.py +++ b/lib/spack/spack/operating_systems/cnl.py @@ -29,8 +29,8 @@ class Cnl(OperatingSystem): return self.name + str(self.version) def _detect_crayos_version(self): - output = module("avail", "PrgEnv-") - matches = re.findall(r'PrgEnv-\w+/(\d+).\d+.\d+', output) + output = module("avail", "PrgEnv-cray") + matches = re.findall(r'PrgEnv-cray/(\d+).\d+.\d+', output) major_versions = set(matches) latest_version = max(major_versions) return latest_version -- cgit v1.2.3-70-g09d2