Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3797468
D2114.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D2114.diff
View Options
diff --git a/_tests/pillar/paas/test_docker.py b/_tests/pillar/paas/test_docker.py
--- a/_tests/pillar/paas/test_docker.py
+++ b/_tests/pillar/paas/test_docker.py
@@ -9,7 +9,7 @@
def setUp(self):
with open(PILLAR_FILE, 'r') as fd:
- self.pillar = yaml.load(fd)
+ self.pillar = yaml.safe_load(fd)
# nginx needs a host/app_port pair to spawn a configuration
def test_host_is_paired_with_app_port_option(self):
diff --git a/_tests/salt_test_case.py b/_tests/salt_test_case.py
--- a/_tests/salt_test_case.py
+++ b/_tests/salt_test_case.py
@@ -12,7 +12,7 @@
@staticmethod
def import_data_from_yaml(filename):
with open(filename, 'r') as fd:
- return yaml.load(fd.read())
+ return yaml.safe_load(fd.read())
def mock_pillar(self, filename=None, target=None):
if not target:
diff --git a/utils/dump-py-state.py b/utils/dump-py-state.py
--- a/utils/dump-py-state.py
+++ b/utils/dump-py-state.py
@@ -39,7 +39,7 @@
pillar = {}
for pillar_file in get_pillar_files(pillar_directory):
- data = yaml.load(open(pillar_file, "r"))
+ data = yaml.safe_load(open(pillar_file, "r"))
pillar.update(data)
return pillar
diff --git a/utils/generate-webcontent-index.py b/utils/generate-webcontent-index.py
--- a/utils/generate-webcontent-index.py
+++ b/utils/generate-webcontent-index.py
@@ -47,7 +47,7 @@
def get_pillar_entry(pillar_file, key):
with open(pillar_file) as fd:
- pillar = yaml.load(fd.read())
+ pillar = yaml.safe_load(fd.read())
return pillar[key]
diff --git a/utils/migrate-ssh-keys.py b/utils/migrate-ssh-keys.py
--- a/utils/migrate-ssh-keys.py
+++ b/utils/migrate-ssh-keys.py
@@ -69,7 +69,7 @@
def read_state():
fd = open(state_file, "r")
- states = yaml.load(fd.read())
+ states = yaml.safe_load(fd.read())
fd.close()
return states[state_key]
diff --git a/utils/next-uid.py b/utils/next-uid.py
--- a/utils/next-uid.py
+++ b/utils/next-uid.py
@@ -17,7 +17,7 @@
def get_shellusers(filename, key):
with open(filename) as stream:
- data = yaml.load(stream)
+ data = yaml.safe_load(stream)
return data[key]
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 11:37 (21 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2271151
Default Alt Text
D2114.diff (2 KB)
Attached To
Mode
D2114: Load safely YAML in Python
Attached
Detach File
Event Timeline
Log In to Comment