X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_lcm%2FROclient.py;h=e731ec1abe8b0952f5e52d265dea50aa0ac427cd;hb=7f26b3f6740e12dd35d8024b14c3fe3a32ec5dbf;hp=cdbde9ce24a4ab61fe41c9a5da53d3b70f916e30;hpb=9e9a923448e6673fc0396265732115b55f1df9da;p=osm%2FLCM.git diff --git a/osm_lcm/ROclient.py b/osm_lcm/ROclient.py index cdbde9c..e731ec1 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): @@ -359,9 +359,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: