Added to_dict back into operating system
This commit is contained in:
parent
4925be0bc4
commit
5715799d4e
@ -195,6 +195,7 @@ def operating_system(self, name):
|
|||||||
name = self.back_os
|
name = self.back_os
|
||||||
|
|
||||||
return self.operating_sys.get(name, None)
|
return self.operating_sys.get(name, None)
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def detect(self):
|
def detect(self):
|
||||||
@ -333,6 +334,12 @@ def find_compiler(self, cmp_cls, *path):
|
|||||||
|
|
||||||
return list(compilers.values())
|
return list(compilers.values())
|
||||||
|
|
||||||
|
def to_dict(self):
|
||||||
|
d = {}
|
||||||
|
d['name'] = self.name
|
||||||
|
d['version'] = self.version
|
||||||
|
|
||||||
|
return d
|
||||||
|
|
||||||
@key_ordering
|
@key_ordering
|
||||||
class Arch(object):
|
class Arch(object):
|
||||||
@ -410,7 +417,8 @@ def _operating_system_from_dict(os_name, platform=None):
|
|||||||
"""
|
"""
|
||||||
if not platform:
|
if not platform:
|
||||||
platform = sys_type()
|
platform = sys_type()
|
||||||
if isinstance(os_name, spack.util.spack_yaml.syaml_dict):
|
if isinstance(os_name, spack.util.spack_yaml.syaml_dict) or \
|
||||||
|
isinstance(os_name, dict):
|
||||||
name = os_name['name']
|
name = os_name['name']
|
||||||
version = os_name['version']
|
version = os_name['version']
|
||||||
return platform.operating_system(name+version)
|
return platform.operating_system(name+version)
|
||||||
|
Loading…
Reference in New Issue
Block a user