From 2224b866d2150f9fa9f6448a72c8a3bd15a57d52 Mon Sep 17 00:00:00 2001 From: dongweiming Date: Thu, 1 Aug 2013 20:10:08 +0800 Subject: [PATCH] old version compatible invalid bug --- glances/glances.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/glances/glances.py b/glances/glances.py index 29b8747e..4ac43b65 100644 --- a/glances/glances.py +++ b/glances/glances.py @@ -3769,7 +3769,7 @@ class GlancesClient(): def client_init(self): try: - self.client.init() + client_version = self.client.init() except ProtocolError as err: if str(err).find(" 401 ") > 0: print(_("Error: Connection to server failed. Bad password.")) @@ -3777,13 +3777,7 @@ class GlancesClient(): else: print(_("Error: Connection to server failed. Unknown error.")) sys.exit(-1) - try: - client_version = self.client.init()[:3] - except: - print(_("Error: Connection to server failed. Can not get the server version.")) - sys.exit(-1) - else: - return __version__[:2] == client_version[:2] + return __version__[:3] == client_version[:3] def client_get_limits(self): try: