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.
This commit is contained in:
Mario Melara 2019-05-20 11:06:02 -07:00 committed by Peter Scheibel
parent 2168c08ac5
commit 4d71117080

View file

@ -29,8 +29,8 @@ def __str__(self):
return self.name + str(self.version) return self.name + str(self.version)
def _detect_crayos_version(self): def _detect_crayos_version(self):
output = module("avail", "PrgEnv-") output = module("avail", "PrgEnv-cray")
matches = re.findall(r'PrgEnv-\w+/(\d+).\d+.\d+', output) matches = re.findall(r'PrgEnv-cray/(\d+).\d+.\d+', output)
major_versions = set(matches) major_versions = set(matches)
latest_version = max(major_versions) latest_version = max(major_versions)
return latest_version return latest_version