-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Labels
Description
Description of Issue/Question
This is an issue I'm opening to remind myself to add this functionality. Using JSnapy as a module is very cumbersome when it comes to dynamically snapshotting/checking a device (your options are either pass a YAML string formatted the same as a config file, which sticks out like a wart in code and suffers from a bunch of weird issues like needing to hard cast the multi-line string from a bytestring to an actual str since extract_data does an isinstance check to see if it's of type str... or write to a .yml file and then pass that as the argument to snap). It'd be much better if we could just pass a dict.
Setup
Code in question
if os.path.isfile(config_data):
data = open(config_data, 'r')
config_data = yaml.load(data)
elif isinstance(config_data, str):
config_data = yaml.load(config_data)
else:
self.logger.info(
colorama.Fore.RED +
"Incorrect config file or data, please chk !!!!", extra=self.log_detail)
exit(1)