From cf04bae19e80a39a62644d1b96f5f58302242280 Mon Sep 17 00:00:00 2001 From: hochikong <1097225749@qq.com> Date: Sun, 24 Jul 2016 22:44:49 +0800 Subject: 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. --- vyroute/basic_function/Modifylo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'vyroute/basic_function/Modifylo.py') diff --git a/vyroute/basic_function/Modifylo.py b/vyroute/basic_function/Modifylo.py index f835c3e..5dca08f 100644 --- a/vyroute/basic_function/Modifylo.py +++ b/vyroute/basic_function/Modifylo.py @@ -15,7 +15,11 @@ def modifylo(obj, data): try: # Configure loopback interface lo address - obj.execute(lo_basic_configuration % data['config']) - return {"Result": "Modify successfully."} + obj.sendline(lo_basic_configuration % data['config']) + obj.prompt() + if len(obj.before) > obj.before.index('\r\n') + 2: + return obj.before + else: + return {"Result": "Modify successfully."} except Exception as e: return {'Error': e} -- cgit v1.2.3