From 6ac610dd796ac39a211a39e54af95f810c0ff813 Mon Sep 17 00:00:00 2001 From: Manuel Buil Date: Tue, 17 Oct 2017 16:34:26 +0200 Subject: Produce more logs if things fail Apex deployment shows a problem when creating the SFC config in ODL and it is impossible to know what might be going on Change-Id: If8d33d1c60daaf9cd9773a5cb9c7e47f64e1caa9 Signed-off-by: Manuel Buil (cherry picked from commit f19a910411260203ff33d290e7460a296f5786fc) --- sfc/lib/utils.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sfc/lib/utils.py') diff --git a/sfc/lib/utils.py b/sfc/lib/utils.py index ce57ad04..5e344187 100644 --- a/sfc/lib/utils.py +++ b/sfc/lib/utils.py @@ -531,6 +531,8 @@ def wait_for_classification_rules(ovs_logger, compute_nodes, odl_ip, odl_port, promised_rsps = promised_rsps_in_computes(odl_ip, odl_port) timeout2 -= 1 if timeout2 == 0: + os_tacker.get_tacker_items() + get_odl_items(odl_ip, odl_port) raise Exception("RSPs not configured in ODL") time.sleep(3) @@ -654,6 +656,33 @@ def format_odl_acl_list_url(odl_ip, odl_port, return acl_list_url +def improve_json_layout(json_response): + return json.dumps(json_response, indent=4, separators=(',', ': ')) + + +def get_odl_items(odl_ip, odl_port): + acl_list_url = format_odl_acl_list_url(odl_ip, odl_port) + sf_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function") + sff_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function-forwarder") + sfc_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "service-function-chain") + rsp_list_url = format_odl_resource_list_url(odl_ip, odl_port, + "rendered-service-path", + datastore="operational") + r_acl = requests.get(acl_list_url).json() + r_sf = requests.get(sf_list_url).json() + r_sff = requests.get(sff_list_url).json() + r_sfc = requests.get(sfc_list_url).json() + r_rsp = requests.get(rsp_list_url).json() + logger.debug("Configured ACLs in ODL: %s" % improve_json_layout(r_acl)) + logger.debug("Configured SFs in ODL: %s" % improve_json_layout(r_sf)) + logger.debug("Configured SFFs in ODL: %s" % improve_json_layout(r_sff)) + logger.debug("Configured SFCs in ODL: %s" % improve_json_layout(r_sfc)) + logger.debug("Configured RSPs in ODL: %s" % improve_json_layout(r_rsp)) + + def get_odl_acl_list(odl_ip, odl_port): acl_list_url = format_odl_acl_list_url(odl_ip, odl_port) r = requests.get(acl_list_url) -- cgit 1.2.3-korg