Update to use safe_load 37/8237/1
authorAdam Israel <adam.israel@canonical.com>
Tue, 26 Nov 2019 14:20:41 +0000 (09:20 -0500)
committerAdam Israel <adam.israel@canonical.com>
Tue, 26 Nov 2019 14:20:41 +0000 (09:20 -0500)
The use of a bare yaml.load with no Loader is deprecated. Use the sugar shortcut safe_load per https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Change-Id: I856d4263fcf20453157f9d3835289e665d1664bf
Signed-off-by: Adam Israel <adam.israel@canonical.com>
tests/base.py

index c7dad6d..aabf359 100644 (file)
@@ -108,7 +108,7 @@ def has_metrics(charm):
 def get_descriptor(descriptor):
     desc = None
     try:
-        tmp = yaml.load(descriptor)
+        tmp = yaml.safe_load(descriptor)
 
         # Remove the envelope
         root = list(tmp.keys())[0]