summaryrefslogtreecommitdiff
path: root/vymgmt/router.py
diff options
context:
space:
mode:
authorhochikong <1097225749@qq.com>2016-08-26 22:04:49 +0800
committerhochikong <1097225749@qq.com>2016-08-26 22:04:49 +0800
commitb6d33086cfecf091a1d4f2afc4bbf4607e4a327c (patch)
treea2bcea05297d6eba7dcaa312302ff77ace2c9150 /vymgmt/router.py
parenta9d1a18af94f3e0f0ac669c51f3acfb1c03058f0 (diff)
downloadpython-vyos-mgmt-b6d33086cfecf091a1d4f2afc4bbf4607e4a327c.tar.gz
python-vyos-mgmt-b6d33086cfecf091a1d4f2afc4bbf4607e4a327c.zip
Fix some logic error in logout()
Fix two mistakes may raise error exceptions in error_distinguish Add a quick start section to README
Diffstat (limited to 'vymgmt/router.py')
-rw-r--r--vymgmt/router.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/vymgmt/router.py b/vymgmt/router.py
index f46955d..15fea9e 100644
--- a/vymgmt/router.py
+++ b/vymgmt/router.py
@@ -52,6 +52,15 @@ class Router(object):
:return: A message or an error
"""
try:
+ if self.__status["commit"] == "No":
+ return "Error : You should commit and exit configure mode first."
+
+ if self.__status["save"] == "No":
+ return "Error : You should save and exit configure mode first."
+
+ if self.__status["configure"] == "Yes":
+ return "Error : You should exit configure mode first."
+
self.__conn.close()
self.__status["status"] = "logout"
self.__status["configure"] = None