summaryrefslogtreecommitdiffstats
path: root/lib/python/apex
diff options
context:
space:
mode:
authorDan Radez <dradez@redhat.com>2016-09-19 15:06:43 -0400
committerDan Radez <dradez@redhat.com>2016-09-20 14:24:17 -0400
commitb6bda2fe154d067084a99733f42663252ff9b399 (patch)
tree17f614866d74c4c805373967cef0a837bf8c0ccc /lib/python/apex
parent58bc90d143303c1f9d4e9f174294f71dfa8303d6 (diff)
Handling file loads and tmp dirs differently
Change-Id: I602279b30b035cfc667e4ee9b83905a638440abb Signed-off-by: Dan Radez <dradez@redhat.com>
Diffstat (limited to 'lib/python/apex')
-rw-r--r--lib/python/apex/common/utils.py2
-rw-r--r--lib/python/apex/deploy_settings.py2
-rw-r--r--lib/python/apex/inventory.py2
-rw-r--r--lib/python/apex/network_environment.py2
-rw-r--r--lib/python/apex/network_settings.py2
5 files changed, 5 insertions, 5 deletions
diff --git a/lib/python/apex/common/utils.py b/lib/python/apex/common/utils.py
index fe34096d..d623638c 100644
--- a/lib/python/apex/common/utils.py
+++ b/lib/python/apex/common/utils.py
@@ -19,5 +19,5 @@ def str2bool(var):
def parse_yaml(yaml_file):
with open(yaml_file) as f:
- parsed_dict = yaml.load(f)
+ parsed_dict = yaml.safe_load(f)
return parsed_dict
diff --git a/lib/python/apex/deploy_settings.py b/lib/python/apex/deploy_settings.py
index b70efdac..c27eecf9 100644
--- a/lib/python/apex/deploy_settings.py
+++ b/lib/python/apex/deploy_settings.py
@@ -40,7 +40,7 @@ class DeploySettings(dict):
init_dict = {}
if type(filename) is str:
with open(filename, 'r') as deploy_settings_file:
- init_dict = yaml.load(deploy_settings_file)
+ init_dict = yaml.safe_load(deploy_settings_file)
else:
# assume input is a dict to build from
init_dict = filename
diff --git a/lib/python/apex/inventory.py b/lib/python/apex/inventory.py
index f4a33b28..aa219680 100644
--- a/lib/python/apex/inventory.py
+++ b/lib/python/apex/inventory.py
@@ -24,7 +24,7 @@ class Inventory(dict):
init_dict = {}
if type(source) is str:
with open(source, 'r') as network_settings_file:
- yaml_dict = yaml.load(network_settings_file)
+ yaml_dict = yaml.safe_load(network_settings_file)
# collapse node identifiers from the structure
init_dict['nodes'] = list(map(lambda n: n[1],
yaml_dict['nodes'].items()))
diff --git a/lib/python/apex/network_environment.py b/lib/python/apex/network_environment.py
index 175f408f..15fe873f 100644
--- a/lib/python/apex/network_environment.py
+++ b/lib/python/apex/network_environment.py
@@ -59,7 +59,7 @@ class NetworkEnvironment(dict):
init_dict = {}
if type(filename) is str:
with open(filename, 'r') as net_env_fh:
- init_dict = yaml.load(net_env_fh)
+ init_dict = yaml.safe_load(net_env_fh)
super().__init__(init_dict)
try:
diff --git a/lib/python/apex/network_settings.py b/lib/python/apex/network_settings.py
index ca91b8cf..8e39afd6 100644
--- a/lib/python/apex/network_settings.py
+++ b/lib/python/apex/network_settings.py
@@ -42,7 +42,7 @@ class NetworkSettings(dict):
init_dict = {}
if type(filename) is str:
with open(filename, 'r') as network_settings_file:
- init_dict = yaml.load(network_settings_file)
+ init_dict = yaml.safe_load(network_settings_file)
else:
# assume input is a dict to build from
init_dict = filename