Replace yaml.load by yaml.safe_load
[osm/NBI.git] / osm_nbi / descriptor_topics.py
index 2814653..ca10c42 100644 (file)
@@ -437,7 +437,7 @@ class DescriptorTopic(BaseTopic):
                 indata = json.load(content)
             else:
                 error_text = "Invalid yaml format "
-                indata = yaml.load(content, Loader=yaml.SafeLoader)
+                indata = yaml.safe_load(content)
 
             # Need to close the file package here so it can be copied from the
             # revision to the current, unrevisioned record
@@ -1323,11 +1323,9 @@ class VnfdTopic(DescriptorTopic):
             with self.fs.file_open(
                 (old_descriptor_directory.rstrip("/"), descriptor_file_name), "r"
             ) as old_descriptor_file:
-
                 with self.fs.file_open(
                     (new_descriptor_directory.rstrip("/"), descriptor_file_name), "r"
                 ) as new_descriptor_file:
-
                     old_content = yaml.safe_load(old_descriptor_file.read())
                     new_content = yaml.safe_load(new_descriptor_file.read())
 
@@ -1719,11 +1717,9 @@ class NsdTopic(DescriptorTopic):
             with self.fs.file_open(
                 (old_descriptor_directory.rstrip("/"), descriptor_file_name), "r"
             ) as old_descriptor_file:
-
                 with self.fs.file_open(
                     (new_descriptor_directory.rstrip("/"), descriptor_file_name), "r"
                 ) as new_descriptor_file:
-
                     old_content = yaml.safe_load(old_descriptor_file.read())
                     new_content = yaml.safe_load(new_descriptor_file.read())