[mod] use more secure yaml.safe_load

This commit is contained in:
Laurent Peuch 2019-04-28 03:51:25 +02:00
parent 31482e7d31
commit 6cceddf70c

View file

@ -29,7 +29,7 @@ subprocess.check_call(cmd, shell=True)
with open(ACTIONSMAP_FILE, 'r') as stream: with open(ACTIONSMAP_FILE, 'r') as stream:
# Getting the dictionary containning what actions are possible per domain # Getting the dictionary containning what actions are possible per domain
OPTION_TREE = yaml.load(stream) OPTION_TREE = yaml.safe_load(stream)
DOMAINS = [str for str in OPTION_TREE.keys() if not str.startswith('_')] DOMAINS = [str for str in OPTION_TREE.keys() if not str.startswith('_')]
DOMAINS_STR = '"{}"'.format(' '.join(DOMAINS)) DOMAINS_STR = '"{}"'.format(' '.join(DOMAINS))
ACTIONS_DICT = {} ACTIONS_DICT = {}