From 2df9850125d948d31a80746ea32f6807a9354ee0 Mon Sep 17 00:00:00 2001 From: Oleksiy Mishchenko Date: Fri, 11 Apr 2008 21:26:02 +0000 Subject: [PATCH] Fix pylint errors for RAPI Reviewed-by: imsnah --- daemons/ganeti-rapi | 10 +++++----- lib/rapi/RESTHTTPServer.py | 4 +--- lib/rapi/resources.py | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/daemons/ganeti-rapi b/daemons/ganeti-rapi index 9825bbf..78552c6 100755 --- a/daemons/ganeti-rapi +++ b/daemons/ganeti-rapi @@ -67,8 +67,8 @@ def ParseOptions(): if options.ssl: if not (options.ssl_cert and options.ssl_key): - print >> sys.stderr, "For secure mode please provide " \ - "--ssl-key and --ssl-cert arguments" + print >> sys.stderr, ("For secure mode please provide " + "--ssl-key and --ssl-cert arguments") sys.exit(1) return options, args @@ -84,7 +84,7 @@ def Port2PID(port): PID number. """ - _NET_STAT = ['/proc/net/tcp','/proc/net/udp'] + _NET_STAT = ['/proc/net/tcp', '/proc/net/udp'] inode2port = {} port2pid = {} @@ -163,8 +163,8 @@ def StopAPI(options): try: pid = Port2PID(options.port) if pid: - print "Stopping Ganeti-RAPI PID: %d, port: %d... " \ - % (pid, options.port), + print ("Stopping Ganeti-RAPI PID: %d, port: %d... " + % (pid, options.port)), os.kill(pid, 9) print "done." else: diff --git a/lib/rapi/RESTHTTPServer.py b/lib/rapi/RESTHTTPServer.py index 534874f..7582601 100644 --- a/lib/rapi/RESTHTTPServer.py +++ b/lib/rapi/RESTHTTPServer.py @@ -1,7 +1,5 @@ #!/usr/bin/python # -# Copyright (C) 2006, 2007 Google Inc. -# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or @@ -62,7 +60,7 @@ class RESTHTTPServer(BaseHTTPServer.HTTPServer): HandlerClass - HTTPRequestHandler object options - Command-line options """ - BaseHTTPServer.HTTPServer.__init__(self,server_address, HandlerClass) + BaseHTTPServer.HTTPServer.__init__(self, server_address, HandlerClass) if options.ssl: # Set up SSL context = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD) diff --git a/lib/rapi/resources.py b/lib/rapi/resources.py index c5288e8..1f662d8 100644 --- a/lib/rapi/resources.py +++ b/lib/rapi/resources.py @@ -101,7 +101,7 @@ class Mapper: class R_Generic(object): - """ Generic class for resources. + """Generic class for resources. """ -- 1.7.10.4