X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2FROclient.py;h=1818e08557230c6d8238c6a1d16035ba52ab682f;hb=refs%2Fchanges%2F77%2F14077%2F2;hp=b9249068d980c10593652d75748d64400e096d36;hpb=e789898a1681e9b8568f57608d7604a447250fe5;p=osm%2FLCM.git diff --git a/osm_lcm/ROclient.py b/osm_lcm/ROclient.py index b924906..1818e08 100644 --- a/osm_lcm/ROclient.py +++ b/osm_lcm/ROclient.py @@ -99,7 +99,7 @@ def remove_envelop(item, indata=None): if len(indata) == 1 and "instance" in indata: clean_indata = indata["instance"] else: - assert False, "remove_envelop with unknown item {}".format(item) + raise ROClientException("remove_envelop with unknown item {}".format(item)) return clean_indata @@ -272,7 +272,7 @@ class ROClient: elif item == "sdn": return {"sdn_controller": indata} else: - assert False, "_create_envelop with unknown item {}".format(item) + raise ROClientException("remove_envelop with unknown item {}".format(item)) @staticmethod def update_descriptor(desc, kwargs): @@ -548,9 +548,10 @@ class ROClient: if item_id: return item_id desc = content[item] - assert isinstance( - desc, list - ), "_get_item_uuid get a non dict with a list inside {}".format(type(desc)) + if not isinstance(desc, list): + raise ROClientException( + "_get_item_uuid get a non dict with a list inside {}".format(type(desc)) + ) uuid = None for i in desc: if item_id_name and i["name"] != item_id_name: