diff options
Diffstat (limited to 'vymgmt/router.py')
-rw-r--r-- | vymgmt/router.py | 9 |
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 |