summaryrefslogtreecommitdiffstats
path: root/nova
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-01-10 14:14:37 +0000
committerTarmac <>2011-01-10 14:14:37 +0000
commitd9d334bb5520bbbc4af6760cabb9bfd022ec13ef (patch)
tree38c56b76a6d39af826d8627b4cbbff35412f45d0 /nova
parentd968ce5b92181a9551f9cd36c899595ca726fb99 (diff)
parent4a9a02575bacb493b57dd83744561a77516bd6ff (diff)
downloadnova-d9d334bb5520bbbc4af6760cabb9bfd022ec13ef.tar.gz
nova-d9d334bb5520bbbc4af6760cabb9bfd022ec13ef.tar.xz
nova-d9d334bb5520bbbc4af6760cabb9bfd022ec13ef.zip
Late import module for register_models() so it doesn't create the db before flags are loaded.
This is a quick fix because trunk is broken for anything but the default database. I really think we ultimately need to remove all code that runs in __init__.py
Diffstat (limited to 'nova')
-rw-r--r--nova/service.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/service.py b/nova/service.py
index 864a42469..523c1a8d7 100644
--- a/nova/service.py
+++ b/nova/service.py
@@ -38,7 +38,6 @@ 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
@@ -209,6 +208,10 @@ 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 %s is unreachable."