Skip to content

Commit

Permalink
different names
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-wilkins committed Oct 29, 2022
1 parent c10f181 commit f34d492
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/sas/system/config/config_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ def save(self):
with open(self.config_filename(True), 'w') as file:
self.save_to_file_object(file)

def become_default(self):
def override_with_defaults(self):
"""
Set the config entries to defaults, and prevent saving from happening
Added with the ability to disable for testing in mind
"""
self._bad_entries.clear()
self.update(self._defaults)
self._disable_writing = True
Expand All @@ -102,7 +107,10 @@ def save_to_file_object(self, file):
Only changed and unknown variables will be included in the saved file
"""

if not self._disable_writing:
if self._disable_writing:
logger.info("Config write disabled by `override_with_defaults`")

else:

data = {}
for key in self._defaults:
Expand Down

0 comments on commit f34d492

Please sign in to comment.