def run(self, prefixes, nexthops): routes = utils.build_routes(prefixes.split(','), nexthops.split(',')) try: self.client.syncFib(self.client.client_id, routes) except Exception as e: print('Failed to sync routes.') print('Exception: {}'.format(e)) sys.exit(1) print('Reprogrammed FIB with {} routes.'.format(len(routes)))
def run(self, prefixes, nexthops): routes = utils.build_routes(prefixes.split(','), nexthops.split(',')) try: self.client.addUnicastRoutes(self.client.client_id, routes) except Exception as e: print('Failed to add routes.') print('Exception: {}'.format(e)) sys.exit(1) print('Added {} routes.'.format(len(routes)))
def run(self, prefixes, nexthops): routes = utils.build_routes(prefixes.split(","), nexthops.split(",")) try: self.client.syncFib(self.client.client_id, routes) except Exception as e: print("Failed to sync routes.") print("Exception: {}".format(e)) return 1 print("Reprogrammed FIB with {} routes.".format(len(routes))) return 0
def run(self, prefixes, nexthops): routes = utils.build_routes(prefixes.split(","), nexthops.split(",")) try: self.client.addUnicastRoutes(self.client.client_id, routes) except Exception as e: print("Failed to add routes.") print("Exception: {}".format(e)) return 1 print("Added {} routes.".format(len(routes))) return 0