Update deprecated use of yaml.load 38/8238/1
authorAdam Israel <adam.israel@canonical.com>
Tue, 26 Nov 2019 14:23:52 +0000 (09:23 -0500)
committerAdam Israel <adam.israel@canonical.com>
Tue, 26 Nov 2019 14:23:52 +0000 (09:23 -0500)
Update the deprecated use of `yaml.load` without a loader, replacing it with a call to the sugar method `yaml.safe_load`. See also: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Change-Id: Ia5b591349ba6da4260545335315d3d07191f76cf
Signed-off-by: Adam Israel <adam.israel@canonical.com>
n2vc/k8s_helm_conn.py

index cd15d73..eac34d4 100644 (file)
@@ -894,7 +894,7 @@ class K8sHelmConnector(K8sConnector):
             for key in params:
                 value = params.get(key)
                 if '!!yaml' in str(value):
-                    value = yaml.load(value[7:])
+                    value = yaml.safe_load(value[7:])
                 params2[key] = value
 
             values_file = get_random_number() + '.yaml'