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
PID number.
"""
- _NET_STAT = ['/proc/net/tcp','/proc/net/udp']
+ _NET_STAT = ['/proc/net/tcp', '/proc/net/udp']
inode2port = {}
port2pid = {}
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:
#!/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
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)