Making yaml load safe
@@ -407,7 +407,7 @@ class Chip:
read_args = json.load(f)
elif abspath.endswith('.yaml'):
with open(abspath, 'r') as f:
- read_args = yaml.load(f, Loader=yaml.FullLoader)
+ read_args = yaml.load(f, Loader=yaml.SafeLoader)
elif abspath.endswith('.tcl'):
read_args = self.readtcl(abspath)
else:
@@ -439,11 +439,12 @@ class Chip:
self.logger.info('Writing configuration to file %s', filepath)
- # Resolve path and make directory if it doesn't exist
- if not os.path.exists(os.path.dirname(filepath)):
- os.makedirs(os.path.dirname(filepath))
+ # Create option to only write out a dict with values set
+ # value!=defvalue and not empty
# Write out configuration based on file type
+ if not os.path.exists(os.path.dirname(filepath)):
+ os.makedirs(os.path.dirname(filepath))
if filepath.endswith('.json'):
with open(filepath, 'w') as f:
