summaryrefslogtreecommitdiffstats
path: root/nova/service.py
diff options
context:
space:
mode:
authorIlya Alekseyev <ialekseev@griddynamics.com>2011-01-11 16:17:49 +0300
committerIlya Alekseyev <ialekseev@griddynamics.com>2011-01-11 16:17:49 +0300
commitaf759efab2f3de57a03a54b9c10c9d606dd1b668 (patch)
treeb1b64f21b10f980b4421737a2caa73fbe71dee9d /nova/service.py
parent1a6fba0ada49a464b372e681b83bac59d3a3a79a (diff)
parent1e746ce1ef027aa2549a8fba2904f3797eff0702 (diff)
downloadnova-af759efab2f3de57a03a54b9c10c9d606dd1b668.tar.gz
nova-af759efab2f3de57a03a54b9c10c9d606dd1b668.tar.xz
nova-af759efab2f3de57a03a54b9c10c9d606dd1b668.zip
Trunk merge and conflcts resolved
Diffstat (limited to 'nova/service.py')
-rw-r--r--nova/service.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/nova/service.py b/nova/service.py
index d4a6f3839..2998ed3e5 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -21,7 +21,6 @@ Generic Node baseclass for all workers that run on hosts
"""
import inspect
-import logging
import os
import sys
import time
@@ -35,10 +34,10 @@ from sqlalchemy.exc import OperationalError
from nova import context
from nova import db
from nova import exception
+from nova import log as logging
from nova import flags
from nova import rpc
from nova import utils
-from nova.db.sqlalchemy import models
FLAGS = flags.FLAGS
@@ -156,7 +155,7 @@ class Service(object):
report_interval = FLAGS.report_interval
if not periodic_interval:
periodic_interval = FLAGS.periodic_interval
- logging.warn(_("Starting %s node"), topic)
+ logging.audit(_("Starting %s node"), topic)
service_obj = cls(host, binary, topic, manager,
report_interval, periodic_interval)
@@ -210,29 +209,28 @@ class Service(object):
logging.exception(_("model server went away"))
try:
+ # NOTE(vish): This is late-loaded to make sure that the
+ # database is not created before flags have
+ # been loaded.
+ from nova.db.sqlalchemy import models
models.register_models()
except OperationalError:
- logging.exception(_("Data store is unreachable."
- " Trying again in %d seconds.") %
- FLAGS.sql_retry_interval)
+ logging.exception(_("Data store %s is unreachable."
+ " Trying again in %d seconds.") %
+ (FLAGS.sql_connection,
+ FLAGS.sql_retry_interval))
time.sleep(FLAGS.sql_retry_interval)
def serve(*services):
- argv = FLAGS(sys.argv)
+ FLAGS(sys.argv)
+ logging.basicConfig()
if not services:
services = [Service.create()]
name = '_'.join(x.binary for x in services)
- logging.debug("Serving %s" % name)
-
- logging.getLogger('amqplib').setLevel(logging.WARN)
-
- if FLAGS.verbose:
- logging.getLogger().setLevel(logging.DEBUG)
- else:
- logging.getLogger().setLevel(logging.WARNING)
+ logging.debug(_("Serving %s"), name)
logging.debug(_("Full set of FLAGS:"))
for flag in FLAGS: