Merge "Add change abandoned logic to jeepyb"
diff --git a/jeepyb/cmd/expire_old_reviews.py b/jeepyb/cmd/expire_old_reviews.py
index 77f9856..fe5956f 100644
--- a/jeepyb/cmd/expire_old_reviews.py
+++ b/jeepyb/cmd/expire_old_reviews.py
@@ -27,10 +27,10 @@
 
 
 def expire_patch_set(ssh, patch_id, patch_subject):
-    message = ('code review expired after 1 week of no activity'
-               ' after a negative review, it can be restored using'
+    message = ('Code review expired after 1 week of no activity'
+               ' after a negative review. It can be restored using'
                ' the \`Restore Change\` button under the Patch Set'
-               ' on the web interface')
+               ' on the web interface.')
     command = ('gerrit review --abandon '
                '--message="{message}" {patch_id}').format(
                    message=message,
diff --git a/jeepyb/cmd/manage_projects.py b/jeepyb/cmd/manage_projects.py
index 2dece22..92962c8 100644
--- a/jeepyb/cmd/manage_projects.py
+++ b/jeepyb/cmd/manage_projects.py
@@ -537,7 +537,7 @@
     else:
         logging.basicConfig(level=logging.ERROR)
 
-    default_has_github = registry.get('has-github', True)
+    default_has_github = registry.get_defaults('has-github', True)
 
     LOCAL_GIT_DIR = registry.get_defaults('local-git-dir', '/var/lib/git')
     JEEPYB_CACHE_DIR = registry.get_defaults('jeepyb-cache-dir',
diff --git a/jeepyb/cmd/notify_impact.py b/jeepyb/cmd/notify_impact.py
index c3c3303..09b92bb 100644
--- a/jeepyb/cmd/notify_impact.py
+++ b/jeepyb/cmd/notify_impact.py
@@ -22,7 +22,7 @@
 #     --change-url https://review.openstack.org/55607 --project nova/ \
 #     --branch master --commit c262de4417d48be599c3a7496ef94de5c84b188c \
 #     --impact DocImpact --dest-address none@localhost --dryrun \
-#     --ignore-duplicates --config foo.yaml \
+#     --config foo.yaml \
 #     change-merged
 #
 # But you'll need a git repository at /home/gerrit2/review_site/git/nova.git
@@ -102,7 +102,7 @@
     Create a launchpad bug in a LP project, titled with the first line of
     the git commit message, with the content of the git_log prepended
     with the Gerrit review URL. Tag the bug with the name of the repository
-    it came from. Don't create a duplicate bug. Returns link to the bug.
+    it came from. Returns link to the bug.
     """
 
     # Determine what LP project to use
@@ -136,28 +136,24 @@
     bug_descr = args.change_url + prelude + '\n' + git_log
     project = lpconn.projects[lp_project]
 
-    # check for existing bugs by searching for the title, to avoid
-    # creating multiple bugs per review
     buglink = None
     author_class = None
-    potential_dupes = project.searchTasks(search_text=bug_title)
 
-    if len(potential_dupes) == 0 or args.ignore_duplicates:
-        buginfo, buglink = actions.create(project, bug_title, bug_descr, args)
+    buginfo, buglink = actions.create(project, bug_title, bug_descr, args)
 
-        # If the author of the merging patch matches our configured
-        # subscriber lists, then subscribe the configured victims.
-        for email_address in config.get('author_map', {}):
-            email_re = re.compile('^Author:.*%s.*' % email_address)
-            for line in bug_descr.split('\n'):
-                m = email_re.match(line)
-                if m:
-                    author_class = config['author_map'][email_address]
+    # If the author of the merging patch matches our configured
+    # subscriber lists, then subscribe the configured victims.
+    for email_address in config.get('author_map', {}):
+        email_re = re.compile('^Author:.*%s.*' % email_address)
+        for line in bug_descr.split('\n'):
+            m = email_re.match(line)
+            if m:
+                author_class = config['author_map'][email_address]
 
-        if author_class:
-            config = config.get('subscriber_map', {}).get(author_class, [])
-            for subscriber in config:
-                actions.subscribe(buginfo, subscriber)
+    if author_class:
+        config = config.get('subscriber_map', {}).get(author_class, [])
+        for subscriber in config:
+            actions.subscribe(buginfo, subscriber)
 
     return buglink
 
@@ -238,13 +234,6 @@
     parser.add_argument('--no-dryrun', dest='dryrun', action='store_false')
     parser.set_defaults(dryrun=False)
 
-    # Ignore duplicates, useful for testing
-    parser.add_argument('--ignore-duplicates', dest='ignore_duplicates',
-                        action='store_true')
-    parser.add_argument('--no-ignore-duplicates', dest='ignore_duplicates',
-                        action='store_false')
-    parser.set_defaults(ignore_duplicates=False)
-
     args = parser.parse_args()
 
     # NOTE(mikal): the basic idea here is to let people watch