Repository: fedora-infra/bodhi

Issue:
Update text in bugs is out of date and strangely formatted
The instructions bodhi puts in each bug for testing an update is strangely formatted and out of date.  Example text:

"kernel-4.2.0-0.rc8.git0.1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update kernel'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14151"

The \n characters look strange there.  Further, yum is no longer used as the package manager in Fedora 22 and newer.  It will still work for now, but it is likely better to change the text to reference dnf.

Update text in bugs is out of date and strangely formatted
The instructions bodhi puts in each bug for testing an update is strangely formatted and out of date.  Example text:

"kernel-4.2.0-0.rc8.git0.1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update kernel'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-14151"

The \n characters look strange there.  Further, yum is no longer used as the package manager in Fedora 22 and newer.  It will still work for now, but it is likely better to change the text to reference dnf.



Discussion:
Thanks for reporting!  Noting here that this is similar to #335.

Thanks for reporting!  Noting here that this is similar to #335.


Resolving patch:
diff --git a/bodhi/models/models.py b/bodhi/models/models.py
--- a/bodhi/models/models.py
+++ b/bodhi/models/models.py
@@ -1941,7 +1941,15 @@ def default_message(self, update):
             update.get_title(delim=', '), "%s %s" % (
                 update.release.long_name, update.status.description))
         if update.status is UpdateStatus.testing:
-            message += config['testing_bug_msg'] % (
+            template = config['testing_bug_msg']
+
+            if update.release.id_prefix == "FEDORA-EPEL":
+                if 'testing_bug_epel_msg' in config:
+                    template = config['testing_bug_epel_msg']
+                else:
+                    log.warn("No 'testing_bug_epel_msg' found in the config.")
+
+            message += template % (
                 ' '.join([build.package.name for build in update.builds]),
                 config.get('base_address') + update.get_url())
         return message


Test patch:
diff --git a/bodhi/tests/test_masher.py b/bodhi/tests/test_masher.py
--- a/bodhi/tests/test_masher.py
+++ b/bodhi/tests/test_masher.py
@@ -709,7 +709,7 @@ def test_absent_gating(self, cmd, publish, *args):
     @mock.patch('bodhi.bugs.bugtracker.on_qa')
     def test_modify_testing_bugs(self, on_qa, modified, *args):
         self.masher.consume(self.msg)
-        on_qa.assert_called_once_with(12345, u"bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems still persist, please make note of it in this bug report.\\nIf you want to test the update, you can install it with \\n su -c 'yum --enablerepo=updates-testing update bodhi'. You can provide feedback for this update here: http://0.0.0.0:6543/updates/FEDORA-%s-0001" % time.localtime().tm_year)
+        on_qa.assert_called_once_with(12345, u"bodhi-2.0-1.fc17 has been pushed to the Fedora 17 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with\n$ su -c 'dnf --enablerepo=updates-testing update bodhi'\nYou can provide feedback for this update here: http://0.0.0.0:6543/updates/FEDORA-%s-0001" % time.localtime().tm_year)
 
     @mock.patch(**mock_taskotron_results)
     @mock.patch('bodhi.consumers.masher.MasherThread.update_comps')