Skip to content

Commit

Permalink
replace deprecated string formats
Browse files Browse the repository at this point in the history
  • Loading branch information
lexming committed Nov 22, 2023
1 parent 321aaf3 commit 3aec83f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/vsc/eb_hooks/hooks_hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def parse_hook(ec, *args, **kwargs): # pylint: disable=unused-argument
if ec.name == 'PMIx':
# Add osdependency on munge-devel
extradep = 'munge-devel'
ec.log.info("[parse hook] Adding OS dependency on: %s" % extradep)
ec.log.info("[parse hook] Adding OS dependency on: %s", extradep)
ec['osdependencies'].append(extradep)
# Add sanity check on munge component
ec.log.info("[parse hook] Adding sanity check on munge component")
Expand Down Expand Up @@ -249,17 +249,18 @@ def pre_module_hook(self, *args, **kwargs): # pylint: disable=unused-argument

# cannot know MODULEPATH in advance for archs with IB variants, use environment at load time
local_arch = os.getenv('VSC_ARCH_LOCAL') + os.getenv("VSC_ARCH_SUFFIX")
archless_path = ['"%s"' % p for p in mod_install_path.split(local_arch)]
archless_path = [f'"{p}"' for p in mod_install_path.split(local_arch)]
if len(archless_path) > 1:
archless_path.insert(1, 'os.getenv("VSC_ARCH_LOCAL") .. os.getenv("VSC_ARCH_SUFFIX")')
modulepath = ", ".join(archless_path)

self.cfg['modluafooter'] = """
self.cfg['modluafooter'] = f"""
-- restrict MODULEPATH to current software generation
if ( mode() ~= "spider" ) then
pushenv("MODULEPATH", "/etc/modulefiles/vsc")
prepend_path("MODULEPATH", pathJoin(%s))
prepend_path("MODULEPATH", pathJoin({modulepath}))
end
""" % ", ".join(archless_path)
"""

# set COMSOL licenses
if self.name == 'COMSOL':
Expand Down

0 comments on commit 3aec83f

Please sign in to comment.