pep8 compliance
This commit is contained in:
parent
3d69762740
commit
efb5363356
@ -62,14 +62,17 @@ flags.DEFINE_flag(flags.HelpFlag())
|
||||
flags.DEFINE_flag(flags.HelpshortFlag())
|
||||
flags.DEFINE_flag(flags.HelpXMLFlag())
|
||||
|
||||
|
||||
def handle_flash_socket_policy(socket):
|
||||
LOG.info(_("Received connection on flash socket policy port"))
|
||||
|
||||
fd = socket.makefile('rw')
|
||||
expected_command = "<policy-file-request/>"
|
||||
if expected_command in fd.read(len(expected_command)+1):
|
||||
LOG.info(_("Received valid flash socket policy request"))
|
||||
fd.write('<?xml version="1.0"?><cross-domain-policy><allow-access-from domain="*" to-ports="%d" /></cross-domain-policy>' % (FLAGS.vncproxy_port))
|
||||
if expected_command in fd.read(len(expected_command) + 1):
|
||||
LOG.info(_("Received valid flash socket policy request"))
|
||||
fd.write('<?xml version="1.0"?><cross-domain-policy><allow-'
|
||||
'access-from domain="*" to-ports="%d" /></cross-'
|
||||
'domain-policy>' % (FLAGS.vncproxy_port))
|
||||
fd.flush()
|
||||
socket.close()
|
||||
|
||||
|
@ -114,7 +114,8 @@ class Server(object):
|
||||
def start_tcp(self, listener, port, host='0.0.0.0', key=None, backlog=128):
|
||||
"""Run a raw TCP server with the given application."""
|
||||
arg0 = sys.argv[0]
|
||||
LOG.info(_('Starting TCP server %(arg0)s on %(host)s:%(port)s') % locals())
|
||||
LOG.info(_('Starting TCP server %(arg0)s on %(host)s:%(port)s')
|
||||
% locals())
|
||||
socket = eventlet.listen((host, port), backlog=backlog)
|
||||
self._tcp_server = self._pool.spawn_n(self._run_tcp, listener, socket)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user