summaryrefslogtreecommitdiffstats
path: root/nova/service.py
diff options
context:
space:
mode:
authorTodd Willey <todd@ansolabs.com>2011-01-07 09:46:17 -0500
committerTodd Willey <todd@ansolabs.com>2011-01-07 09:46:17 -0500
commit52aa05daf90d5100cd74ec553404becace9c2444 (patch)
tree7b532844df2082803038144f053167c44e3e6ef6 /nova/service.py
parent59b3e0f2700d6a9067bffe045ea335b7abc35a27 (diff)
parente33102d23ec8f357c08e2583f8d9e3c1753bab4d (diff)
downloadnova-52aa05daf90d5100cd74ec553404becace9c2444.tar.gz
nova-52aa05daf90d5100cd74ec553404becace9c2444.tar.xz
nova-52aa05daf90d5100cd74ec553404becace9c2444.zip
Merge trunk.
Diffstat (limited to 'nova/service.py')
-rw-r--r--nova/service.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/nova/service.py b/nova/service.py
index a459f8df4..05503b52b 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -23,11 +23,14 @@ Generic Node baseclass for all workers that run on hosts
import inspect
import os
import sys
+import time
from eventlet import event
from eventlet import greenthread
from eventlet import greenpool
+from sqlalchemy.exc import OperationalError
+
from nova import context
from nova import db
from nova import exception
@@ -35,6 +38,7 @@ 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
@@ -204,6 +208,14 @@ class Service(object):
self.model_disconnected = True
logging.exception(_("model server went away"))
+ try:
+ models.register_models()
+ except OperationalError:
+ logging.exception(_("Data store is unreachable."
+ " Trying again in %d seconds.") %
+ FLAGS.sql_retry_interval)
+ time.sleep(FLAGS.sql_retry_interval)
+
def serve(*services):
FLAGS(sys.argv)