summaryrefslogtreecommitdiff
path: root/vyroute/Router.py
diff options
context:
space:
mode:
authorHochikong <michellehzg@gmail.com>2016-06-08 10:59:52 +0800
committerHochikong <michellehzg@gmail.com>2016-06-08 10:59:52 +0800
commita4a14765415f8252e94307f657383a3ee66d2fa7 (patch)
tree2a78195d4e3a3bd882cc46b3e413c65e31db1709 /vyroute/Router.py
parent99bfc986fe21ddf8c5c91a77e6db9c59d91cdb15 (diff)
downloadpython-vyos-mgmt-a4a14765415f8252e94307f657383a3ee66d2fa7.tar.gz
python-vyos-mgmt-a4a14765415f8252e94307f657383a3ee66d2fa7.zip
T85:Python management library is not Python3 compatible.
Fix Router.py and all file in basic_function/ to support Python3.
Diffstat (limited to 'vyroute/Router.py')
-rw-r--r--vyroute/Router.py34
1 files changed, 17 insertions, 17 deletions
diff --git a/vyroute/Router.py b/vyroute/Router.py
index 28b3184..0b92002 100644
--- a/vyroute/Router.py
+++ b/vyroute/Router.py
@@ -103,7 +103,7 @@ class BasicRouter(Router):
return {"Result": "Login successfully."}
else:
return {"Error": "Connect Failed."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def logout(self):
@@ -116,7 +116,7 @@ class BasicRouter(Router):
self.__status["object"] = "logout"
self.__status["configure"] = None
return {"Result": "Logout successfully."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def configure(self):
@@ -134,7 +134,7 @@ class BasicRouter(Router):
return {"Error": "In configure mode now!"}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def commit_config(self):
@@ -157,7 +157,7 @@ class BasicRouter(Router):
return {"Error": "Router not in configure mode!"}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def save_config(self):
@@ -183,7 +183,7 @@ class BasicRouter(Router):
return {"Error": "Router not in configure mode!"}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def exit_config(self, force=False):
@@ -217,7 +217,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode,need not exit."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def lo(self, data):
@@ -250,7 +250,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def delete_route(self, data):
@@ -283,7 +283,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def static_route(self, data):
@@ -316,7 +316,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def rip_route(self, data):
@@ -349,7 +349,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def ospf_area(self, data):
@@ -382,7 +382,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def router_id(self, data):
@@ -415,7 +415,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def ospf_redistribute(self, data):
@@ -448,7 +448,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def ospf_adjacency(self):
@@ -476,7 +476,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def ospf_default_route(self, data):
@@ -509,7 +509,7 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
+ except Exception as e:
return {"Error": e}
def ospf_route_map(self, data):
@@ -542,5 +542,5 @@ class BasicRouter(Router):
return {"Error": "You are not in configure mode."}
else:
return {"Error": "Router object not connect to a router."}
- except Exception, e:
- return {"Error": e} \ No newline at end of file
+ except Exception as e:
+ return {"Error": e}