Skip to content

Commit eb43118

Browse files
committed
temporary fix of moving registry entiry to end (so no comments are eaten) and printing warning
Signed-off-by: vsoch <[email protected]>
1 parent d129dad commit eb43118

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

shpc/main/settings.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ def add(self, key, value):
126126
value = list(set(current))
127127
self._settings[key] = value
128128
self.change_validate(key, value)
129+
logger.warning(
130+
"Warning: Check with shpc config edit - ordering of list can change."
131+
)
129132

130133
def remove(self, key, value):
131134
"""
@@ -139,6 +142,9 @@ def remove(self, key, value):
139142
current.pop(current.index(value))
140143
self._settings[key] = current
141144
self.change_validate(key, current)
145+
logger.warning(
146+
"Warning: Check with shpc config edit - ordering of list can change."
147+
)
142148

143149
def set(self, key, value):
144150
"""
@@ -206,13 +212,8 @@ def save(self, filename=None):
206212
logger.exit("A filename is required to save to.")
207213
yaml = YAML()
208214

209-
# This requires Python 3.7 support
210-
try:
211-
with open(filename, "w") as fd:
212-
yaml.dump(self._settings, fd, sort_keys=False)
213-
except:
214-
with open(filename, "w") as fd:
215-
yaml.dump(self._settings, fd)
215+
with open(filename, "w") as fd:
216+
yaml.dump(self._settings, fd)
216217

217218
def __iter__(self):
218219
for key, value in self.__dict__.items():

shpc/settings.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ config_editor: vim
1313
# set a default container technology (singularity or podman)
1414
container_tech: singularity
1515

16-
# Registry Recipes (order of paths here is honored for search path))
17-
registry:
18-
- $root_dir/registry
19-
2016
# Lmod or Environment Modules settings
2117
# The install directory for modules. Defaults to the install directory/modules
2218
module_base: $root_dir/modules
@@ -58,3 +54,7 @@ environment_file: 99-shpc.sh
5854
# container features like gpu will modify generated recipes
5955
container_features:
6056
gpu: # one of null, amd, or nvidia
57+
58+
# Registry Recipes (order of paths here is honored for search path))
59+
registry:
60+
- $root_dir/registry

0 commit comments

Comments
 (0)