diff options
Diffstat (limited to 'vyroute/basic_function')
-rw-r--r-- | vyroute/basic_function/DeleteRoute.py | 4 | ||||
-rw-r--r-- | vyroute/basic_function/Modifylo.py | 2 | ||||
-rw-r--r-- | vyroute/basic_function/OSPFRoute.py | 12 | ||||
-rw-r--r-- | vyroute/basic_function/RIPRoute.py | 2 | ||||
-rw-r--r-- | vyroute/basic_function/StaticRoute.py | 2 |
5 files changed, 11 insertions, 11 deletions
diff --git a/vyroute/basic_function/DeleteRoute.py b/vyroute/basic_function/DeleteRoute.py index d612466..da3f8e9 100644 --- a/vyroute/basic_function/DeleteRoute.py +++ b/vyroute/basic_function/DeleteRoute.py @@ -38,5 +38,5 @@ def deleteroute(obj, data): return {"Result": "Delete successfully."} else: return {"Error": "Nonsupport protocols type."} - except Exception, e: - return {"Error": e}
\ No newline at end of file + except Exception as e: + return {"Error": e} diff --git a/vyroute/basic_function/Modifylo.py b/vyroute/basic_function/Modifylo.py index b2a7959..f835c3e 100644 --- a/vyroute/basic_function/Modifylo.py +++ b/vyroute/basic_function/Modifylo.py @@ -17,5 +17,5 @@ def modifylo(obj, data): # Configure loopback interface lo address obj.execute(lo_basic_configuration % data['config']) return {"Result": "Modify successfully."} - except Exception, e: + except Exception as e: return {'Error': e} diff --git a/vyroute/basic_function/OSPFRoute.py b/vyroute/basic_function/OSPFRoute.py index 1290467..0c3367c 100644 --- a/vyroute/basic_function/OSPFRoute.py +++ b/vyroute/basic_function/OSPFRoute.py @@ -16,7 +16,7 @@ def ospfarea(obj, data): # Configure ospf area obj.execute(ospf_basic_configuration % (data['config']['area'], data['config']['network'])) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} @@ -36,7 +36,7 @@ def router_id(obj, data): # Configure router id obj.execute(router_id_configuration % data['config']['id']) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} @@ -58,7 +58,7 @@ def ospf_redistribute(obj, data): obj.execute(redistribute_configuration['0'] % data['config']['type']) obj.execute(redistribute_configuration['1']) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} @@ -72,7 +72,7 @@ def ospf_adjacency(obj): try: obj.execute(log_adjacency_changes_configuration) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} @@ -97,7 +97,7 @@ def ospf_default_route(obj, data): obj.execute(default_route_configuration['1'] % data['config']['metric']) obj.execute(default_route_configuration['2'] % data['config']['metric-type']) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} @@ -119,5 +119,5 @@ def ospf_route_map(obj, data): obj.execute(route_map_configuration['0'] % data['config']['rule']) obj.execute(route_map_configuration['1'] % (data['config']['rule'], data['config']['interface'])) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} diff --git a/vyroute/basic_function/RIPRoute.py b/vyroute/basic_function/RIPRoute.py index 2ce73cd..a493eac 100644 --- a/vyroute/basic_function/RIPRoute.py +++ b/vyroute/basic_function/RIPRoute.py @@ -17,5 +17,5 @@ def riproute(obj, data): obj.execute(rip_basic_configuration % data['config']) obj.execute(redistribute_configuration) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {"Error": e} diff --git a/vyroute/basic_function/StaticRoute.py b/vyroute/basic_function/StaticRoute.py index ac6627d..6240877 100644 --- a/vyroute/basic_function/StaticRoute.py +++ b/vyroute/basic_function/StaticRoute.py @@ -18,5 +18,5 @@ def staticroute(obj, data): data['config']['next-hop'], data['config']['distance'])) return {"Result": "Configured successfully"} - except Exception, e: + except Exception as e: return {'Error': e}
\ No newline at end of file |