Merge "Stop writing project configs"
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index eb5b75c..af46218 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -263,20 +263,20 @@
                                has_issues=has_issues,
                                has_downloads=has_downloads,
                                has_wiki=has_wiki)
+        if description:
+            repo.edit(repo_name, description=description)
+        if homepage:
+            repo.edit(repo_name, homepage=homepage)
+        repo.edit(repo_name, has_issues=has_issues,
+                  has_downloads=has_downloads,
+                  has_wiki=has_wiki)
+
+        if 'gerrit' not in [team.name for team in repo.get_teams()]:
+            teams = org.get_teams()
+            teams_dict = dict(zip([t.name.lower() for t in teams], teams))
+            teams_dict['gerrit'].add_to_repos(repo)
         created = True
-    if description:
-        repo.edit(repo_name, description=description)
-    if homepage:
-        repo.edit(repo_name, homepage=homepage)
 
-    repo.edit(repo_name, has_issues=has_issues,
-              has_downloads=has_downloads,
-              has_wiki=has_wiki)
-
-    if 'gerrit' not in [team.name for team in repo.get_teams()]:
-        teams = org.get_teams()
-        teams_dict = dict(zip([t.name.lower() for t in teams], teams))
-        teams_dict['gerrit'].add_to_repos(repo)
     return created
 
 
diff --git a/jeepyb/gerritdb.py b/jeepyb/gerritdb.py
index c3be3d7..2255b64 100644
--- a/jeepyb/gerritdb.py
+++ b/jeepyb/gerritdb.py
@@ -47,9 +47,11 @@
         gerrit_config = get_broken_config(GERRIT_CONFIG)
         secure_config = get_broken_config(GERRIT_SECURE_CONFIG)
 
+        DB_HOST = gerrit_config.get("database", "hostname")
         DB_USER = gerrit_config.get("database", "username")
         DB_PASS = secure_config.get("database", "password")
         DB_DB = gerrit_config.get("database", "database")
 
-        db_connection = MySQLdb.connect(user=DB_USER, passwd=DB_PASS, db=DB_DB)
+        db_connection = MySQLdb.connect(
+            host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_DB)
     return db_connection