From 3f17ef02a7369ee895c26bcc84bfdb2e9e5a6fab Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 31 Jan 2011 14:58:26 +0100 Subject: [PATCH] burner: Trivial code cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use constant for exit value - Configure logging from main function, not from class' β__init__β Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: RenΓ© Nussbaumer <rn@google.com> --- tools/burnin | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/burnin b/tools/burnin index 61d453fa0..b1b0d2bb1 100755 --- a/tools/burnin +++ b/tools/burnin @@ -258,7 +258,6 @@ class Burner(object): def __init__(self): """Constructor.""" - utils.SetupLogging(constants.LOG_BURNIN, debug=False, stderr_logging=True) self.url_opener = SimpleOpener() self._feed_buf = StringIO() self.nodes = [] @@ -1065,14 +1064,16 @@ class Burner(object): else: # non-expected error raise - return 0 + return constants.EXIT_SUCCESS def main(): - """Main function""" + """Main function. - burner = Burner() - return burner.BurninCluster() + """ + utils.SetupLogging(constants.LOG_BURNIN, debug=False, stderr_logging=True) + + return Burner().BurninCluster() if __name__ == "__main__": -- GitLab