From a4a14765415f8252e94307f657383a3ee66d2fa7 Mon Sep 17 00:00:00 2001 From: Hochikong Date: Wed, 8 Jun 2016 10:59:52 +0800 Subject: T85:Python management library is not Python3 compatible. Fix Router.py and all file in basic_function/ to support Python3. --- vyroute/basic_function/OSPFRoute.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'vyroute/basic_function/OSPFRoute.py') 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} -- cgit v1.2.3