summaryrefslogtreecommitdiffstats
path: root/nova/service.py
diff options
context:
space:
mode:
authorEldar Nugaev <enugaev@griddynamics.com>2011-01-07 06:18:01 +0300
committerEldar Nugaev <enugaev@griddynamics.com>2011-01-07 06:18:01 +0300
commit1a6fba0ada49a464b372e681b83bac59d3a3a79a (patch)
tree5246b72f9bf695fee0f2cf0d5511a5c5e71b0f98 /nova/service.py
parent579d0e1437efb32ef1a1c50ddbfca9093cfa3d18 (diff)
parent3478e90442ad7a22497b53153ae893df96e55b4e (diff)
downloadnova-1a6fba0ada49a464b372e681b83bac59d3a3a79a.tar.gz
nova-1a6fba0ada49a464b372e681b83bac59d3a3a79a.tar.xz
nova-1a6fba0ada49a464b372e681b83bac59d3a3a79a.zip
merge
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 a612ac592..d4a6f3839 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -24,17 +24,21 @@ import inspect
import logging
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
from nova import flags
from nova import rpc
from nova import utils
+from nova.db.sqlalchemy import models
FLAGS = flags.FLAGS
@@ -205,6 +209,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):
argv = FLAGS(sys.argv)