From 5fc9984ce584b9f0a0982f4d5ce958cac8df9128 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 13 Nov 2012 16:36:21 -0500 Subject: fixed client lock check --- src/lib/Bcfg2/Client/Client.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/lib/Bcfg2/Client/Client.py') diff --git a/src/lib/Bcfg2/Client/Client.py b/src/lib/Bcfg2/Client/Client.py index 0400e3ff7..636aa5177 100644 --- a/src/lib/Bcfg2/Client/Client.py +++ b/src/lib/Bcfg2/Client/Client.py @@ -106,7 +106,9 @@ class Client(object): self.logger.info(ret.text) finally: os.unlink(scriptname) - except: # pylint: disable=W0702 + except SystemExit: + raise + except: self._probe_failure(name, sys.exc_info()[1]) return ret @@ -258,8 +260,7 @@ class Client(object): except Bcfg2.Client.XML.ParseError: syntax_error = sys.exc_info()[1] self.fatal_error("The configuration could not be parsed: %s" % - (syntax_error)) - return(1) + syntax_error) times['config_parse'] = time.time() @@ -296,10 +297,13 @@ class Client(object): "If you what to bypass the check, run " "with %s option" % Bcfg2.Options.OMIT_LOCK_CHECK.cmd) - except: # pylint: disable=W0702 + except SystemExit: + raise + except: lockfile = None self.logger.error("Failed to open lockfile") - # execute the said configuration + + # execute the configuration self.tools.Execute() if not self.setup['omit_lock_check']: -- cgit v1.2.3-1-g7c22 From 2fecc7a73e658f3977e0351f900694a68f404db3 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 14 Nov 2012 10:25:51 -0500 Subject: fixed typos in error message --- src/lib/Bcfg2/Client/Client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/Bcfg2/Client/Client.py') diff --git a/src/lib/Bcfg2/Client/Client.py b/src/lib/Bcfg2/Client/Client.py index 636aa5177..f197a9074 100644 --- a/src/lib/Bcfg2/Client/Client.py +++ b/src/lib/Bcfg2/Client/Client.py @@ -293,9 +293,9 @@ class Client(object): fcntl.LOCK_EX | fcntl.LOCK_NB) except IOError: # otherwise exit and give a warning to the user - self.fatal_error("An other instance of Bcfg2 is running. " - "If you what to bypass the check, run " - "with %s option" % + self.fatal_error("Another instance of Bcfg2 is running. " + "If you want to bypass the check, run " + "with the %s option" % Bcfg2.Options.OMIT_LOCK_CHECK.cmd) except SystemExit: raise -- cgit v1.2.3-1-g7c22