diff options
Diffstat (limited to 'tests/topotests/lib/common_config.py')
| -rw-r--r-- | tests/topotests/lib/common_config.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py index ce35bdc0fe..9174389bea 100644 --- a/tests/topotests/lib/common_config.py +++ b/tests/topotests/lib/common_config.py @@ -336,16 +336,15 @@ def start_router_daemons(tgen, router, daemons): router_list = tgen.routers() # Start daemons - result = router_list[router].startDaemons(daemons) - return result + res = router_list[router].startDaemons(daemons) except Exception as e: errormsg = traceback.format_exc() logger.error(errormsg) - return errormsg + res = errormsg logger.debug("Exiting lib API: {}".format(sys._getframe().f_code.co_name)) - return True + return res def kill_mininet_routers_process(tgen): @@ -1376,12 +1375,14 @@ def generate_ips(network, no_of_ips): return ipaddress_list start_ip = ipaddress.IPv4Address(unicode(start_ip)) step = 2 ** (32 - mask) - if addr_type == "ipv6": + elif addr_type == "ipv6": if start_ip == "0::0" and mask == 0 and no_of_ips == 1: ipaddress_list.append("{}/{}".format(start_ip, mask)) return ipaddress_list start_ip = ipaddress.IPv6Address(unicode(start_ip)) step = 2 ** (128 - mask) + else: + return [] next_ip = start_ip count = 0 @@ -2390,14 +2391,7 @@ def create_bgp_community_lists(tgen, input_dict, build=False): logger.error(errormsg) return False - try: - community_type = int(community_type) - cmd = "{} {} {} {}".format(cmd, community_type, action, value) - except ValueError: - - cmd = "{} {} {} {} {}".format( - cmd, community_type, name, action, value - ) + cmd = "{} {} {} {} {}".format(cmd, community_type, name, action, value) if del_action: cmd = "no {}".format(cmd) |
