~ubuntu-branches/ubuntu/saucy/nova/saucy-proposed

« back to all changes in this revision

Viewing changes to bin/nova-compute

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Adam Gandelman
  • Date: 2013-02-22 09:27:29 UTC
  • mfrom: (1.1.68)
  • Revision ID: package-import@ubuntu.com-20130222092729-nn3gt8rf97uvts77
Tags: 2013.1.g3-0ubuntu1
[ Chuck Short ]
* New usptream release. 
* debian/patches/debian/patches/fix-ubuntu-tests.patch: Refreshed.
* debian/nova-baremetal.logrotate: Fix logfile path.
* debian/control, debian/nova-spiceproxy.{install, logrotate, upstart}:
  Add spice html5 proxy support.
* debian/nova-novncproxy.upstart: Start on runlevel [2345]
* debian/rules: Call testr directly since run_tests.sh -N gives weird return
  value when tests pass.
* debian/pyddist-overrides: Add websockify.
* debian/nova-common.postinst: Removed config file conversion, since
  the option is no longer available. (LP: #1110567)
* debian/control: Add python-pyasn1 as a dependency.
* debian/control: Add python-oslo-config as a dependency.
* debian/control: Suggest sysfsutils, sg3-utils, multipath-tools for fibre
  channel support.

[ Adam Gandelman ]
* debian/control: Fix typo (websocikfy -> websockify).

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
import os
33
33
import sys
 
34
import traceback
 
35
 
 
36
from oslo.config import cfg
34
37
 
35
38
# If ../nova/__init__.py exists, add ../ to Python search path, so that
36
39
# it will override what happens to be installed in /usr/(local/)lib/python...
42
45
 
43
46
 
44
47
from nova import config
45
 
from nova.openstack.common import cfg
 
48
import nova.db.api
 
49
from nova import exception
46
50
from nova.openstack.common import log as logging
47
51
from nova import service
48
52
from nova import utils
49
53
 
50
54
CONF = cfg.CONF
51
55
CONF.import_opt('compute_topic', 'nova.compute.rpcapi')
 
56
CONF.import_opt('use_local', 'nova.conductor.api', group='conductor')
 
57
LOG = logging.getLogger('nova.compute')
 
58
 
 
59
 
 
60
def block_db_access():
 
61
    class NoDB(object):
 
62
        def __getattr__(self, attr):
 
63
            return self
 
64
 
 
65
        def __call__(self, *args, **kwargs):
 
66
            stacktrace = "".join(traceback.format_stack())
 
67
            LOG.error('No db access allowed in nova-compute: %s' % stacktrace)
 
68
            raise exception.DBNotAllowed('nova-compute')
 
69
 
 
70
    nova.db.api.IMPL = NoDB()
 
71
 
52
72
 
53
73
if __name__ == '__main__':
54
74
    config.parse_args(sys.argv)
55
75
    logging.setup('nova')
56
76
    utils.monkey_patch()
 
77
 
 
78
    if not CONF.conductor.use_local:
 
79
        block_db_access()
 
80
 
57
81
    server = service.Service.create(binary='nova-compute',
58
 
                                    topic=CONF.compute_topic)
 
82
                                    topic=CONF.compute_topic,
 
83
                                    db_allowed=False)
59
84
    service.serve(server)
60
85
    service.wait()