~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to bin/nova-novncproxy

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
import websockify
30
30
 
 
31
from nova import config
 
32
from nova.consoleauth import rpcapi as consoleauth_rpcapi
31
33
from nova import context
32
 
from nova import flags
33
34
from nova.openstack.common import cfg
34
35
from nova.openstack.common import log as logging
35
36
from nova.openstack.common import rpc
65
66
               default=6080,
66
67
               help='Port on which to listen for incoming requests'),
67
68
    ]
68
 
FLAGS = flags.FLAGS
69
 
FLAGS.register_cli_opts(opts)
 
69
 
 
70
CONF = cfg.CONF
 
71
CONF.register_cli_opts(opts)
70
72
LOG = logging.getLogger(__name__)
71
73
 
72
74
 
84
86
        cookie.load(self.headers.getheader('cookie'))
85
87
        token = cookie['token'].value
86
88
        ctxt = context.get_admin_context()
87
 
        connect_info = rpc.call(ctxt, 'consoleauth',
88
 
                                {'method': 'check_token',
89
 
                                 'args': {'token': token}})
 
89
        rpcapi = consoleauth_rpcapi.ConsoleAuthAPI()
 
90
        connect_info = rpcapi.check_token(ctxt, token=token)
90
91
 
91
92
        if not connect_info:
92
93
            LOG.audit("Invalid Token: %s", token)
129
130
 
130
131
 
131
132
if __name__ == '__main__':
132
 
    if FLAGS.ssl_only and not os.path.exists(FLAGS.cert):
133
 
        parser.error("SSL only and %s not found" % FLAGS.cert)
 
133
    if CONF.ssl_only and not os.path.exists(CONF.cert):
 
134
        parser.error("SSL only and %s not found" % CONF.cert)
134
135
 
135
136
    # Setup flags
136
 
    flags.parse_args(sys.argv)
 
137
    config.parse_args(sys.argv)
137
138
 
138
139
    # Check to see if novnc html/js/css files are present
139
 
    if not os.path.exists(FLAGS.web):
140
 
        print "Can not find novnc html/js/css files at %s." % FLAGS.web
 
140
    if not os.path.exists(CONF.web):
 
141
        print "Can not find novnc html/js/css files at %s." % CONF.web
141
142
        sys.exit(-1)
142
143
 
143
144
    # Create and start the NovaWebSockets proxy
144
 
    server = NovaWebSocketProxy(listen_host=FLAGS.novncproxy_host,
145
 
                                listen_port=FLAGS.novncproxy_port,
146
 
                                source_is_ipv6=FLAGS.source_is_ipv6,
147
 
                                verbose=FLAGS.verbose,
148
 
                                cert=FLAGS.cert,
149
 
                                key=FLAGS.key,
150
 
                                ssl_only=FLAGS.ssl_only,
151
 
                                daemon=FLAGS.daemon,
152
 
                                record=FLAGS.record,
153
 
                                web=FLAGS.web,
 
145
    server = NovaWebSocketProxy(listen_host=CONF.novncproxy_host,
 
146
                                listen_port=CONF.novncproxy_port,
 
147
                                source_is_ipv6=CONF.source_is_ipv6,
 
148
                                verbose=CONF.verbose,
 
149
                                cert=CONF.cert,
 
150
                                key=CONF.key,
 
151
                                ssl_only=CONF.ssl_only,
 
152
                                daemon=CONF.daemon,
 
153
                                record=CONF.record,
 
154
                                web=CONF.web,
154
155
                                target_host='ignore',
155
156
                                target_port='ignore',
156
157
                                wrap_mode='exit',