+ response = put_request(url, headers, ODL_LOGIN, ODL_PWD)
+ if wait_until_log_contains(TPCE_LOG, re.escape("Triggering notification stream NETCONF for node "+node_id), 60):
+ print("Node "+node_id+" correctly added to tpce topology", end='... ', flush=True)
+ else:
+ print("Node "+node_id+" still not added to tpce topology", end='... ', flush=True)
+ if response.status_code == requests.codes.ok:
+ print("It was probably loaded at start-up", end='... ', flush=True)
+ # TODO an else-clause to abort test would probably be nice here
+ return response
+
+
+def unmount_device(node_id):
+ url = ("{}/config/network-topology:network-topology/topology/topology-netconf/node/"
+ + node_id).format(RESTCONF_BASE_URL)
+ response = delete_request(url, ODL_LOGIN, ODL_PWD)
+ if wait_until_log_contains(TPCE_LOG, re.escape("onDeviceDisConnected: "+node_id), 60):
+ print("Node "+node_id+" correctly deleted from tpce topology", end='... ', flush=True)
+ else:
+ print("Node "+node_id+" still not deleted from tpce topology", end='... ', flush=True)
+ return response