summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMario Melara <maamelara@gmail.com>2016-06-03 16:16:59 -0700
committerMario Melara <maamelara@gmail.com>2016-06-03 16:16:59 -0700
commit30c204a0a5ca116d2e6ab1ab177e103a5857ca4e (patch)
treefa527dd2ace7b93f9fa67c6ceee88cc2bbb92c6c /lib
parentbc557cc76503cd7694051ddf5a2529a646810b90 (diff)
downloadspack-30c204a0a5ca116d2e6ab1ab177e103a5857ca4e.tar.gz
spack-30c204a0a5ca116d2e6ab1ab177e103a5857ca4e.tar.bz2
spack-30c204a0a5ca116d2e6ab1ab177e103a5857ca4e.tar.xz
spack-30c204a0a5ca116d2e6ab1ab177e103a5857ca4e.zip
Made a merge commit earlier with Todd fixing all_platforms, but changed how architecture looks in spec.yaml. Just three strings. Also made some flake8 formatting changes
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index e74e72d6cd..818731cbf8 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -384,7 +384,6 @@ class Arch(object):
target = self.target.name
else:
target = self.target
- print (platform, platform_os, target)
return (platform, platform_os, target)
def to_dict(self):
@@ -421,19 +420,10 @@ def _operating_system_from_dict(os_name, platform=None):
def _platform_from_dict(platform_name):
""" Constructs a platform from a dictionary. """
- platform_path = spack.platform_path
- mod_string = "spack.platforms"
-
- for p in list_modules(platform_path):
- if platform_name == p:
- mod_name = mod_string + platform_name
- path = join_path(platform_path, platform_name) + ".py"
- mod = imp.load_source(mod_name, path)
- platform_class = mod_to_class(platform_name)
- cls = getattr(mod, platform_class)
- platform = cls()
- return platform
- return None
+ platform_list = all_platforms()
+ for p in platform_list:
+ if platform_name.replace("_", "").lower() == p.__name__.lower():
+ return p()
def arch_from_dict(d):