~markmc/nova/flat-dhcp-without-bridge-iface

« back to all changes in this revision

Viewing changes to bin/nova-vncproxy

  • Committer: Tarmac
  • Author(s): Vishvananda Ishaya
  • Date: 2011-08-19 00:04:02 UTC
  • mfrom: (1450.4.8 united-launch-strategy)
  • Revision ID: tarmac-20110819000402-dp9hs0eosmunud8x
Makes all of the binary services launch using the same strategy.
 * Removes helper methods from utils for loading flags and logging
 * Changes service.serve to use Launcher
 * Changes service.wait to actually wait for all the services to exit
 * Changes nova-api to explicitly load flags and logging and use service.serve
 * Fixes the annoying IOError when /etc/nova/nova.conf doesn't exist

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
"""VNC Console Proxy Server."""
20
20
 
21
21
import eventlet
22
 
import gettext
 
22
eventlet.monkey_patch()
 
23
 
23
24
import os
24
25
import sys
25
26
 
29
30
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
30
31
    sys.path.insert(0, possible_topdir)
31
32
 
32
 
gettext.install('nova', unicode=1)
33
33
 
34
34
from nova import flags
35
35
from nova import log as logging
41
41
from nova.vnc import proxy
42
42
 
43
43
 
44
 
LOG = logging.getLogger('nova.vnc-proxy')
 
44
LOG = logging.getLogger('nova.vncproxy')
45
45
 
46
46
 
47
47
FLAGS = flags.FLAGS
81
81
    FLAGS(sys.argv)
82
82
    logging.setup()
83
83
 
84
 
    LOG.audit(_("Starting nova-vnc-proxy node (version %s)"),
 
84
    LOG.audit(_("Starting nova-vncproxy node (version %s)"),
85
85
              version.version_string_with_vcs())
86
86
 
87
87
    if not (os.path.exists(FLAGS.vncproxy_wwwroot) and
107
107
    else:
108
108
        with_auth = auth.VNCNovaAuthMiddleware(with_logging)
109
109
 
110
 
    service.serve()
111
 
 
112
110
    server = wsgi.Server("VNC Proxy",
113
111
                         with_auth,
114
112
                         host=FLAGS.vncproxy_host,
115
113
                         port=FLAGS.vncproxy_port)
116
 
    server.start()
117
114
    server.start_tcp(handle_flash_socket_policy, 843, host=FLAGS.vncproxy_host)
118
 
 
119
 
    server.wait()
 
115
    service.serve(server)
 
116
    service.wait()