~zulcss/ubuntu/precise/quantum/trunk

« back to all changes in this revision

Viewing changes to quantum/service.py

  • Committer: Chuck Short
  • Date: 2012-11-26 19:51:11 UTC
  • mfrom: (26.1.1 raring-proposed)
  • Revision ID: zulcss@ubuntu.com-20121126195111-jnz2cr4xi6whemw2
* New upstream release for the Ubuntu Cloud Archive.
* debian/patches/*: Refreshed for opening of Grizzly.
* New upstream release.
* debian/rules: FTFBS if there is missing binaries.
* debian/quantum-server.install: Add quantum-debug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#    License for the specific language governing permissions and limitations
16
16
#    under the License.
17
17
 
18
 
import logging
 
18
import logging as std_logging
19
19
 
20
20
from quantum.common import config
21
21
from quantum.openstack.common import cfg
 
22
from quantum.openstack.common import log as logging
22
23
from quantum import wsgi
23
24
 
24
25
 
59
60
        # Log the options used when starting if we're in debug mode...
60
61
 
61
62
        config.setup_logging(cfg.CONF)
62
 
        LOG.debug("*" * 80)
63
 
        LOG.debug("Configuration options gathered from config file:")
64
 
        LOG.debug("================================================")
65
 
        items = dict([(k, v) for k, v in cfg.CONF.items()
66
 
                      if k not in ('__file__', 'here')])
67
 
        for key, value in sorted(items.items()):
68
 
            LOG.debug("%(key)-30s %(value)s" % {'key': key,
69
 
                                                'value': value,
70
 
                                                })
71
 
        LOG.debug("*" * 80)
 
63
        # Dump the initial option values
 
64
        cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
72
65
        service = cls(app_name)
73
66
        return service
74
67
 
77
70
    try:
78
71
        service = cls.create()
79
72
    except Exception:
80
 
        logging.exception('in WsgiService.create()')
 
73
        LOG.exception('in WsgiService.create()')
81
74
        raise
82
75
 
83
76
    service.start()
92
85
        return
93
86
    server = wsgi.Server("Quantum")
94
87
    server.start(app, cfg.CONF.bind_port, cfg.CONF.bind_host)
 
88
    # Dump all option values here after all options are parsed
 
89
    cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
 
90
    LOG.info("Quantum service started, listening on %(host)s:%(port)s" %
 
91
             {'host': cfg.CONF.bind_host,
 
92
              'port': cfg.CONF.bind_port})
95
93
    return server