Merge "Add gerrit change hook parameters for Gerrit 2.11"
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 3bca041..f125975 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -89,12 +89,12 @@
     cmd_list = shlex.split(str(cmd))
     newenv = os.environ
     newenv.update(env)
-    log.debug("Executing command: %s" % " ".join(cmd_list))
+    log.info("Executing command: %s" % " ".join(cmd_list))
     p = subprocess.Popen(cmd_list, stdout=subprocess.PIPE,
                          stderr=subprocess.STDOUT, env=newenv)
     (out, nothing) = p.communicate()
-    log.info("Return code: %s" % p.returncode)
-    log.info("Command said: %s" % out.strip())
+    log.debug("Return code: %s" % p.returncode)
+    log.debug("Command said: %s" % out.strip())
     if status:
         return (p.returncode, out.strip())
     return out.strip()
diff --git a/jeepyb/cmd/notify_impact.py b/jeepyb/cmd/notify_impact.py
index e665c05..2a01a13 100644
--- a/jeepyb/cmd/notify_impact.py
+++ b/jeepyb/cmd/notify_impact.py
@@ -114,14 +114,17 @@
     project_name = args.project.rstrip('/')
     lp_project = projects.docimpact_target(project_name)
     if lp_project == 'unknown':
-        prelude = ('\n\nDear documentation bug triager. This bug was created '
-                   'here because we did not know how to map the project name '
-                   '"%s" to a launchpad project name. This indicates that the '
-                   'notify_impact config needs tweaks. You can ask the '
+
+        prelude = ('\n\Dear bug triager. This bug was created since a '
+                   'commit was marked with DOCIMPACT.\n'
+                   'Your project "%s" is set up so that we directly report '
+                   'the documentation bugs against it. If this needs '
+                   'changing, the docimpact-group option needs to be added '
+                   'for the project. You can ask the '
                    'OpenStack infra team (#openstack-infra on freenode) for '
                    'help if you need to.\n'
                    % args.project)
-        lp_project = 'openstack-manuals'
+        lp_project = project_name
 
     lpconn = launchpad.Launchpad.login_with(
         'Gerrit User Sync',
diff --git a/jeepyb/cmd/update_blueprint.py b/jeepyb/cmd/update_blueprint.py
index 7a421a7..7fa09d1 100644
--- a/jeepyb/cmd/update_blueprint.py
+++ b/jeepyb/cmd/update_blueprint.py
@@ -26,7 +26,7 @@
 
 from launchpadlib import launchpad
 from launchpadlib import uris
-import MySQLdb
+import pymysql
 
 from jeepyb import projects as p
 
@@ -158,8 +158,8 @@
         'Gerrit User Sync', uris.LPNET_SERVICE_ROOT, GERRIT_CACHE_DIR,
         credentials_file=GERRIT_CREDENTIALS, version='devel')
 
-    conn = MySQLdb.connect(
-        host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_DB)
+    conn = pymysql.connect(
+        host=DB_HOST, user=DB_USER, password=DB_PASS, db=DB_DB)
 
     find_specs(lpconn, conn, args)
 
diff --git a/jeepyb/cmd/update_bug.py b/jeepyb/cmd/update_bug.py
index 8b64e88..5f457f5 100644
--- a/jeepyb/cmd/update_bug.py
+++ b/jeepyb/cmd/update_bug.py
@@ -215,7 +215,7 @@
 
     if args.hook == "change-merged":
         if args.branch == 'master':
-            if (p.is_direct_release(args.project) and
+            if (not p.is_delay_release(args.project) and
                     task.needs_change('set_fix_released')):
                 set_fix_released(bugtask)
             else:
diff --git a/jeepyb/gerritdb.py b/jeepyb/gerritdb.py
index 3f5db66..79f311a 100644
--- a/jeepyb/gerritdb.py
+++ b/jeepyb/gerritdb.py
@@ -53,9 +53,9 @@
         DB_DB = gerrit_config.get("database", "database")
 
         if DB_TYPE.upper() == "MYSQL":
-            import MySQLdb
-            db_connection = MySQLdb.connect(
-                host=DB_HOST, user=DB_USER, passwd=DB_PASS, db=DB_DB)
+            import pymysql
+            db_connection = pymysql.connect(
+                host=DB_HOST, user=DB_USER, password=DB_PASS, db=DB_DB)
         else:
             import psycopg2
             db_connection = psycopg2.connect(
diff --git a/jeepyb/projects.py b/jeepyb/projects.py
index 5caaa66..043f7cf 100644
--- a/jeepyb/projects.py
+++ b/jeepyb/projects.py
@@ -21,7 +21,7 @@
   groups:
     - awesome-group
   options:
-    - direct-release
+    - delay-release
     - no-launchpad-bugs
     - no-launchpad-blueprints
 """
@@ -82,9 +82,9 @@
         return False
 
 
-def is_direct_release(project_full_name):
+def is_delay_release(project_full_name):
     try:
-        return 'direct-release' in registry[project_full_name]['options']
+        return 'delay-release' in registry[project_full_name]['options']
     except KeyError:
         return False
 
diff --git a/requirements.txt b/requirements.txt
index 65d5218..9390472 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -2,7 +2,7 @@
 
 argparse
 gerritlib>=0.3.0
-MySQL-python
+PyMySQL
 paramiko
 PyGithub
 pyyaml