use yaml.safe_load() instead of yaml.load()

our yaml is trusted so we don't have any security risk, but this saves a
warning message on run, and it's better anyway since we don't have any
use of the full yaml loader.
Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent a97c97ec
......@@ -5,7 +5,7 @@ import sys
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
data = yaml.load(f)
data = yaml.safe_load(f)
class Host:
......
......@@ -4,7 +4,7 @@ import os
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
data = yaml.load(f)
data = yaml.safe_load(f)
for host in data:
print('Host', host['hostname'])
......
......@@ -4,6 +4,6 @@ import os
import yaml
with open(os.path.join(os.path.dirname(__file__), 'list.yml')) as f:
d = yaml.load(f)
d = yaml.safe_load(f)
for host in d:
print(host['hostname'])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment