From: garciadeblas Date: Tue, 2 Aug 2022 15:19:14 +0000 (+0200) Subject: Use of yaml.safe_load instead of yaml.load X-Git-Tag: release-v13.0-start~19 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F24%2F12424%2F2;p=osm%2FLCM.git Use of yaml.safe_load instead of yaml.load Change-Id: Ic508f205abfd0b71362d3f124b0ec2c4d8f0a17c Signed-off-by: garciadeblas --- diff --git a/osm_lcm/tests/test_ns.py b/osm_lcm/tests/test_ns.py index d7192c9..1441e72 100644 --- a/osm_lcm/tests/test_ns.py +++ b/osm_lcm/tests/test_ns.py @@ -122,19 +122,19 @@ class TestMyNS(asynctest.TestCase): print("kwargs > {}".format(kwargs)) if args: if "update" in args: - ro_ns_desc = yaml.load( - descriptors.ro_update_action_text, Loader=yaml.Loader + ro_ns_desc = yaml.safe_load( + descriptors.ro_update_action_text ) while True: yield ro_ns_desc if kwargs.get("delete"): - ro_ns_desc = yaml.load( - descriptors.ro_delete_action_text, Loader=yaml.Loader + ro_ns_desc = yaml.safe_load( + descriptors.ro_delete_action_text ) while True: yield ro_ns_desc - ro_ns_desc = yaml.load(descriptors.ro_ns_text, Loader=yaml.Loader) + ro_ns_desc = yaml.safe_load(descriptors.ro_ns_text) # if ip address provided, replace descriptor ip_addresses = getenv("OSMLCMTEST_NS_IPADDRESS", "") @@ -177,34 +177,34 @@ class TestMyNS(asynctest.TestCase): self.db = Database({"database": {"driver": "memory"}}).instance.db self.db.create_list( - "vnfds", yaml.load(descriptors.db_vnfds_text, Loader=yaml.Loader) + "vnfds", yaml.safe_load(descriptors.db_vnfds_text) ) self.db.create_list( "vnfds_revisions", - yaml.load(descriptors.db_vnfds_revisions_text, Loader=yaml.Loader), + yaml.safe_load(descriptors.db_vnfds_revisions_text), ) self.db.create_list( - "nsds", yaml.load(descriptors.db_nsds_text, Loader=yaml.Loader) + "nsds", yaml.safe_load(descriptors.db_nsds_text) ) self.db.create_list( - "nsrs", yaml.load(descriptors.db_nsrs_text, Loader=yaml.Loader) + "nsrs", yaml.safe_load(descriptors.db_nsrs_text) ) self.db.create_list( "vim_accounts", - yaml.load(descriptors.db_vim_accounts_text, Loader=yaml.Loader), + yaml.safe_load(descriptors.db_vim_accounts_text), ) self.db.create_list( "k8sclusters", - yaml.load(descriptors.db_k8sclusters_text, Loader=yaml.Loader), + yaml.safe_load(descriptors.db_k8sclusters_text), ) self.db.create_list( - "nslcmops", yaml.load(descriptors.db_nslcmops_text, Loader=yaml.Loader) + "nslcmops", yaml.safe_load(descriptors.db_nslcmops_text) ) self.db.create_list( - "vnfrs", yaml.load(descriptors.db_vnfrs_text, Loader=yaml.Loader) + "vnfrs", yaml.safe_load(descriptors.db_vnfrs_text) ) - self.db_vim_accounts = yaml.load( - descriptors.db_vim_accounts_text, Loader=yaml.Loader + self.db_vim_accounts = yaml.safe_load( + descriptors.db_vim_accounts_text ) # Mock kafka