+ def _obtain_url(self, sdnc_dict):
+ url = sdnc_dict.get("url")
+ if url:
+ return url
+ else:
+ if not sdnc_dict.get("ip") or not sdnc_dict.get("port"):
+ raise Exception("You must provide a URL to contact the SDN Controller")
+ else:
+ return "http://{}:{}/onos/v1/devices".format(
+ sdnc_dict["ip"], sdnc_dict["port"]
+ )
+