Skip to content

Commit

Permalink
Merge pull request #113 from HPC-SimTools/importlib
Browse files Browse the repository at this point in the history
Explicitly import importlib.util
  • Loading branch information
rosswhitfield authored Feb 22, 2021
2 parents 595acad + 2b2d480 commit 3b84569
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ipsframework/configurationManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import sys
import importlib
import importlib.util
import tempfile
import logging
import socket
Expand Down Expand Up @@ -191,7 +192,7 @@ def initialize(self, data_mgr, resource_mgr, task_mgr):
plat_keys = list(self.platform_conf.keys())
for (k, v) in os.environ.items():
if k not in plat_keys \
and not any([x in v for x in '{}()$']):
and not any(x in v for x in '{}()$'):
self.platform_conf[k] = v

mpirun_version = self.platform_conf.get('MPIRUN_VERSION', 'OpenMPI-generic')
Expand Down Expand Up @@ -241,7 +242,7 @@ def initialize(self, data_mgr, resource_mgr, task_mgr):
# giving precedence to config file definitions in case of duplicates
conf_keys = list(conf.keys())
for (k, v) in os.environ.items():
if k not in conf_keys and not any([x in v for x in '{}()$']):
if k not in conf_keys and not any(x in v for x in '{}()$'):
conf[k] = v

# Allow simulation file to override platform values
Expand Down Expand Up @@ -615,7 +616,7 @@ def create_simulation(self, sim_name, config_file, override, sub_workflow=False)
for (k, v) in os.environ.items():
# Do not include functions from environment
if k not in conf_keys and \
not any([x in v for x in '{}()$']):
not any(x in v for x in '{}()$'):
conf[k] = v

# Allow propagation of entries from platform config file to simulation
Expand Down
2 changes: 1 addition & 1 deletion ipsframework/ips_dakota_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run(self): # noqa: C901
# Import environment variables into config file
# giving precedence to config file definitions in case of duplicates
for (k, v) in os.environ.items():
if k not in list(self.template_conf.keys()) and not any([x in v for x in '{}()$']):
if k not in list(self.template_conf.keys()) and not any(x in v for x in '{}()$'):
self.template_conf[k] = v

alt_paths.append(self.template_conf['IPS_ROOT'])
Expand Down

0 comments on commit 3b84569

Please sign in to comment.