[Asterisk-code-review] Remove YAMLLoadWarning: calling yaml.load() (...testsuite[master])

Rodrigo Ramirez Norambuena asteriskteam at digium.com
Thu Apr 25 17:09:26 CDT 2019


Rodrigo Ramirez Norambuena has uploaded this change for review. ( https://gerrit.asterisk.org/c/testsuite/+/11308


Change subject: Remove YAMLLoadWarning: calling yaml.load()
......................................................................

Remove YAMLLoadWarning: calling yaml.load()

>From PyYAML 5.1 yaml.load(x) the use as plain is deprecated

This change use a SafeLoader as Loader for the yaml.load called function

Info: https://msg.pyyaml.org/load
Change-Id: I2d4ef93ad0c8503040e4a673d819f5a0c075f0f6
---
M lib/python/asterisk/test_config.py
M runtests.py
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/testsuite refs/changes/08/11308/1

diff --git a/lib/python/asterisk/test_config.py b/lib/python/asterisk/test_config.py
index 6d2318d..4860cb3 100644
--- a/lib/python/asterisk/test_config.py
+++ b/lib/python/asterisk/test_config.py
@@ -374,7 +374,7 @@
 
         test_config = "%s/test-config.yaml" % self.test_name
         with open(test_config, "r") as config_file:
-            self.config = yaml.load(config_file)
+            self.config = yaml.load(config_file, Loader=yaml.SafeLoader)
 
         if not self.config:
             print("ERROR: Failed to load configuration for test '%s'" %
diff --git a/runtests.py b/runtests.py
index d1bc4aa..fe04213 100755
--- a/runtests.py
+++ b/runtests.py
@@ -772,7 +772,7 @@
         print("Unexpected error: %s" % sys.exc_info()[0])
         return None
 
-    config = yaml.load(f)
+    config = yaml.load(f, Loader=yaml.SafeLoader)
     f.close()
 
     return config

-- 
To view, visit https://gerrit.asterisk.org/c/testsuite/+/11308
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: testsuite
Gerrit-Branch: master
Gerrit-Change-Id: I2d4ef93ad0c8503040e4a673d819f5a0c075f0f6
Gerrit-Change-Number: 11308
Gerrit-PatchSet: 1
Gerrit-Owner: Rodrigo Ramirez Norambuena <a at rodrigoramirez.com>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20190425/2539344f/attachment.html>


More information about the asterisk-code-review mailing list