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

« back to all changes in this revision

Viewing changes to nova/console/xvp.py

  • 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:
25
25
from nova import context
26
26
from nova import db
27
27
from nova import exception
28
 
from nova import flags
29
28
from nova.openstack.common import cfg
30
29
from nova.openstack.common import log as logging
31
30
from nova import utils
49
48
               help='port for XVP to multiplex VNC connections on'),
50
49
    ]
51
50
 
52
 
FLAGS = flags.FLAGS
53
 
FLAGS.register_opts(xvp_opts)
 
51
CONF = cfg.CONF
 
52
CONF.register_opts(xvp_opts)
 
53
CONF.import_opt('host', 'nova.config')
 
54
CONF.import_opt('pybasedir', 'nova.config')
54
55
LOG = logging.getLogger(__name__)
55
56
 
56
57
 
58
59
    """Sets up XVP config, and manages XVP daemon."""
59
60
 
60
61
    def __init__(self):
61
 
        self.xvpconf_template = open(FLAGS.console_xvp_conf_template).read()
62
 
        self.host = FLAGS.host  # default, set by manager.
 
62
        self.xvpconf_template = open(CONF.console_xvp_conf_template).read()
 
63
        self.host = CONF.host  # default, set by manager.
63
64
        super(XVPConsoleProxy, self).__init__()
64
65
 
65
66
    @property
71
72
        #TODO(mdragon): implement port selection for non multiplex ports,
72
73
        #               we are not using that, but someone else may want
73
74
        #               it.
74
 
        return FLAGS.console_xvp_multiplex_port
 
75
        return CONF.console_xvp_multiplex_port
75
76
 
76
77
    def setup_console(self, context, console):
77
78
        """Sets up actual proxies."""
104
105
            LOG.debug('No console pools!')
105
106
            self._xvp_stop()
106
107
            return
107
 
        conf_data = {'multiplex_port': FLAGS.console_xvp_multiplex_port,
 
108
        conf_data = {'multiplex_port': CONF.console_xvp_multiplex_port,
108
109
                     'pools': pools,
109
110
                     'pass_encode': self.fix_console_password}
110
111
        config = str(Template.Template(self.xvpconf_template,
113
114
        self._xvp_restart()
114
115
 
115
116
    def _write_conf(self, config):
116
 
        LOG.debug(_('Re-wrote %s') % FLAGS.console_xvp_conf)
117
 
        with open(FLAGS.console_xvp_conf, 'w') as cfile:
 
117
        LOG.debug(_('Re-wrote %s') % CONF.console_xvp_conf)
 
118
        with open(CONF.console_xvp_conf, 'w') as cfile:
118
119
            cfile.write(config)
119
120
 
120
121
    def _xvp_stop(self):
134
135
        LOG.debug(_('Starting xvp'))
135
136
        try:
136
137
            utils.execute('xvp',
137
 
                          '-p', FLAGS.console_xvp_pid,
138
 
                          '-c', FLAGS.console_xvp_conf,
139
 
                          '-l', FLAGS.console_xvp_log)
 
138
                          '-p', CONF.console_xvp_pid,
 
139
                          '-c', CONF.console_xvp_conf,
 
140
                          '-l', CONF.console_xvp_log)
140
141
        except exception.ProcessExecutionError, err:
141
142
            LOG.error(_('Error starting xvp: %s') % err)
142
143
 
151
152
 
152
153
    def _xvp_pid(self):
153
154
        try:
154
 
            with open(FLAGS.console_xvp_pid, 'r') as pidfile:
 
155
            with open(CONF.console_xvp_pid, 'r') as pidfile:
155
156
                pid = int(pidfile.read())
156
157
        except IOError:
157
158
            return None