summaryrefslogtreecommitdiff
path: root/vyroute/basic_function/StaticRoute.py
diff options
context:
space:
mode:
Diffstat (limited to 'vyroute/basic_function/StaticRoute.py')
-rw-r--r--vyroute/basic_function/StaticRoute.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/vyroute/basic_function/StaticRoute.py b/vyroute/basic_function/StaticRoute.py
index b70ed19..9bdf378 100644
--- a/vyroute/basic_function/StaticRoute.py
+++ b/vyroute/basic_function/StaticRoute.py
@@ -14,9 +14,13 @@ def staticroute(obj, data):
try:
# Configure static router
- obj.execute(static_basic_configuration % (data['config']['target'],
- data['config']['next-hop'],
- data['config']['distance']))
- return {"Result": "Configured successfully"}
+ obj.sendline(static_basic_configuration % (data['config']['target'],
+ data['config']['next-hop'],
+ data['config']['distance']))
+ obj.prompt()
+ if len(obj.before) > obj.before.index('\r\n') + 2:
+ return obj.before
+ else:
+ return {"Result": "Configured successfully"}
except Exception as e:
return {'Error': e}