Skip to content
Snippets Groups Projects
Commit c8a84f9e authored by Pelle Koster's avatar Pelle Koster
Browse files

get-interface-stats register errors and exit non-zero

parent ade63e80
Branches
Tags
No related merge requests found
...@@ -85,9 +85,13 @@ def get_netconf(router_name, vendor=Vendor.JUNIPER, **kwargs): ...@@ -85,9 +85,13 @@ def get_netconf(router_name, vendor=Vendor.JUNIPER, **kwargs):
source_dir = _APP_CONFIG_PARAMS.get("testing", {}).get("netconf-source-dir") source_dir = _APP_CONFIG_PARAMS.get("testing", {}).get("netconf-source-dir")
if source_dir: if source_dir:
if vendor == Vendor.JUNIPER: if vendor == Vendor.JUNIPER:
return juniper.get_netconf_interface_info_from_source_dir(router_name, source_dir) return juniper.get_netconf_interface_info_from_source_dir(
router_name, source_dir
)
else: else:
return nokia.get_netconf_interface_info_from_source_dir(router_name, source_dir) return nokia.get_netconf_interface_info_from_source_dir(
router_name, source_dir
)
ssh_params = _APP_CONFIG_PARAMS[vendor.value] ssh_params = _APP_CONFIG_PARAMS[vendor.value]
if vendor == Vendor.JUNIPER: if vendor == Vendor.JUNIPER:
...@@ -97,7 +101,10 @@ def get_netconf(router_name, vendor=Vendor.JUNIPER, **kwargs): ...@@ -97,7 +101,10 @@ def get_netconf(router_name, vendor=Vendor.JUNIPER, **kwargs):
def validate_router_hosts( def validate_router_hosts(
hostnames: List[str], vendor: Vendor, inprov_hosts=None, load_interfaces_=load_interfaces hostnames: List[str],
vendor: Vendor,
inprov_hosts=None,
load_interfaces_=load_interfaces,
): ):
if inprov_hosts is None: if inprov_hosts is None:
return True return True
...@@ -207,6 +214,8 @@ def main( ...@@ -207,6 +214,8 @@ def main(
logger.exception( logger.exception(
f"Error while processing {vendor_str} {router}", exc_info=e f"Error while processing {vendor_str} {router}", exc_info=e
) )
error_count += 1
if raise_errors: if raise_errors:
raise raise
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment