diff options
author | hochikong <1097225749@qq.com> | 2016-07-24 22:44:49 +0800 |
---|---|---|
committer | hochikong <1097225749@qq.com> | 2016-07-24 22:44:49 +0800 |
commit | cf04bae19e80a39a62644d1b96f5f58302242280 (patch) | |
tree | 063533f5ec5152761bbdc856d79c7673dcda5b4b /vyroute/basic_function/RIPRoute.py | |
parent | b07b336d6a674ae18636274e4dd78df1c372cf78 (diff) | |
download | python-vyos-mgmt-cf04bae19e80a39a62644d1b96f5f58302242280.tar.gz python-vyos-mgmt-cf04bae19e80a39a62644d1b96f5f58302242280.zip |
T86 Python management library methods give timeouts
Use pxssh replace exscript
Attention:When you execute the logout method,you can't use this object any more.You must create a new BasicRouter substance to login the former VyOS system.
Diffstat (limited to 'vyroute/basic_function/RIPRoute.py')
-rw-r--r-- | vyroute/basic_function/RIPRoute.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/vyroute/basic_function/RIPRoute.py b/vyroute/basic_function/RIPRoute.py index a493eac..cb421e0 100644 --- a/vyroute/basic_function/RIPRoute.py +++ b/vyroute/basic_function/RIPRoute.py @@ -14,8 +14,21 @@ def riproute(obj, data): redistribute_configuration = "set protocols rip redistribute connected" try: # Configure RIP router + reg = 0 + error_messsage = [] obj.execute(rip_basic_configuration % data['config']) + obj.prompt() + if len(obj.before) > obj.before.index('\r\n') + 2: + error_messsage.append(obj.before) + reg += 1 obj.execute(redistribute_configuration) - return {"Result": "Configured successfully"} + obj.prompt() + if len(obj.before) > obj.before.index('\r\n') + 2: + error_messsage.append(obj.before) + reg += 1 + if reg > 0: + return error_messsage + else: + return {"Result": "Configured successfully"} except Exception as e: return {"Error": e} |