From b6d33086cfecf091a1d4f2afc4bbf4607e4a327c Mon Sep 17 00:00:00 2001 From: hochikong <1097225749@qq.com> Date: Fri, 26 Aug 2016 22:04:49 +0800 Subject: Fix some logic error in logout() Fix two mistakes may raise error exceptions in error_distinguish Add a quick start section to README --- vymgmt/router.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'vymgmt/router.py') 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 -- cgit v1.2.3