--- a/server/python/run-raindrop.py
+++ b/server/python/run-raindrop.py
@@ -180,18 +180,23 @@ def main():
# create an initial deferred to perform tasks which must occur before we
# can start. The final callback added will fire up the real servers.
asynch_tasks = []
d = defer.Deferred()
def mutter(whateva):
print "Raindrops keep falling on my head..."
d.addCallback(mutter)
- # Check DB exists.
- d.addCallback(model.fab_db)
+ # Check DB exists and if not, install accounts.
+ def maybe_install_accounts(db_created):
+ if db_created:
+ return bootstrap.install_accounts(None)
+ d.addCallback(model.fab_db
+ ).addCallback(maybe_install_accounts
+ )
# Check if the files on the filesystem need updating.
d.addCallback(bootstrap.install_client_files, options)
d.addCallback(bootstrap.install_views, options)
# Now process the args specified.
for arg in args:
try:
func = all_args[arg]