Fix pylint errors for RAPI
authorOleksiy Mishchenko <oleksiy@google.com>
Fri, 11 Apr 2008 21:26:02 +0000 (21:26 +0000)
committerOleksiy Mishchenko <oleksiy@google.com>
Fri, 11 Apr 2008 21:26:02 +0000 (21:26 +0000)
Reviewed-by: imsnah

daemons/ganeti-rapi
lib/rapi/RESTHTTPServer.py
lib/rapi/resources.py

index 9825bbf..78552c6 100755 (executable)
@@ -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:
index 534874f..7582601 100644 (file)
@@ -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)
index c5288e8..1f662d8 100644 (file)
@@ -101,7 +101,7 @@ class Mapper:
 
 
 class R_Generic(object):
-  """ Generic class for resources.
+  """Generic class for resources.
 
   """