We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Reset multi builds update that failed merging a side tag to pending
If a multi builds update fails to be merge in stable, the approve testing cron job will add a new comment to the update every times it run.
To avoid this we need to reset the update status to pending, but we also need to be able to move back the update to testing when the update is edited (build added or build removed).

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `bodhi/server/tasks/updates.py`
Content:
```
1 # Copyright 2015-2019 Red Hat Inc., and others.
2 #
3 # This file is part of Bodhi.
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License along with
16 # this program; if not, write to the Free Software Foundation, Inc., 51
17 # Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
18 """
19 The "updates handler".
20 
21 This module is responsible for doing value-added work "offline" that used to be
22 done when updates were submitted.  Specifically, when someone submits an update
23 we used to:
24 
25 - Update any bugs in bugzilla associated with the update.
26 - Check for test cases in the wiki.
27 
28 Those things could sometimes take a *very* long time, especially if there were
29 lots of builds and lots of bugs in the update.
30 
31 Now, update-submission breezes by those steps and simply tells the user "OK".
32 A message gets published when their update goes through, and *that* message
33 gets received here and triggers us to do all that network-laden heavy lifting.
34 """
35 
36 import logging
37 import time
38 
39 from bodhi.server import util, bugs as bug_module
40 from bodhi.server.config import config
41 from bodhi.server.exceptions import BodhiException
42 from bodhi.server.models import Bug, Update, UpdateType
43 
44 
45 log = logging.getLogger('bodhi')
46 
47 
48 class UpdatesHandler:
49     """
50     Perform background tasks when updates are created or edited.
51 
52     This Celery task is run when an update is created or editied in the frontend,
53     and performs background tasks such as modifying Bugzilla issues (and loading information from
54     Bugzilla so we can display it to the user) and looking up wiki test cases.
55 
56     Attributes:
57         db_factory (bodhi.server.util.TransactionalSessionMaker): A context manager that yields a
58             database session.
59         handle_bugs (bool): If True, interact with Bugzilla. Else do not.
60     """
61 
62     def __init__(self, *args, **kwargs):
63         """Initialize the UpdatesHandler."""
64         self.db_factory = util.transactional_session_maker()
65 
66         self.handle_bugs = bool(config.get('bodhi_email'))
67         if not self.handle_bugs:
68             log.warning("No bodhi_email defined; not fetching bug details")
69 
70     def run(self, api_version: int, data: dict):
71         """
72         Process the given message, updating relevant bugs and test cases.
73 
74         Duplicate messages: if the server delivers the message multiple times,
75         the bugs and test cases are simply re-fetched and updated, so nothing
76         bad happens.
77 
78         Args:
79             api_version: API version number.
80             data: Information about a new or edited update.
81         """
82         action = data["action"]
83         alias = data['update'].get('alias')
84 
85         log.info("Updates Handler handling  %s, %s" % (alias, action))
86 
87         # Go to sleep for a second to try and avoid a race condition
88         # https://github.com/fedora-infra/bodhi/issues/458
89         time.sleep(1)
90 
91         with self.db_factory() as session:
92             update = Update.get(alias)
93             if not update:
94                 raise BodhiException("Couldn't find alias '%s' in DB" % alias)
95 
96             bugs = []
97             if action == "edit":
98                 for idx in data['new_bugs']:
99                     bug = Bug.get(idx)
100 
101                     # Sanity check
102                     if bug is None or bug not in update.bugs:
103                         update_bugs_ids = [b.bug_id for b in update.bugs]
104                         update.update_bugs(update_bugs_ids + [idx], session)
105 
106                         # Now, after update.update_bugs, bug with idx should exists in DB
107                         bug = Bug.get(idx)
108 
109                     bugs.append(bug)
110 
111             elif action == "testing":
112                 bugs = update.bugs
113             else:
114                 raise NotImplementedError("Should never get here.")
115 
116             self.work_on_bugs(session, update, bugs)
117             self.fetch_test_cases(session, update)
118 
119         if config['test_gating.required']:
120             with self.db_factory() as session:
121                 update = Update.get(alias)
122                 update.update_test_gating_status()
123 
124         log.info("Updates Handler done with %s, %s" % (alias, action))
125 
126     def fetch_test_cases(self, session, update):
127         """
128         Query the wiki for test cases for each package on the given update.
129 
130         Args:
131             session (sqlalchemy.orm.session.Session): A database session.
132             update (bodhi.server.models.Update): The update's builds are iterated upon to find test
133                 cases for their associated Packages..
134         """
135         for build in update.builds:
136             try:
137                 build.package.fetch_test_cases(session)
138             except BodhiException:
139                 log.warning('Error occurred during fetching testcases', exc_info=True)
140 
141     def work_on_bugs(self, session, update, bugs):
142         """
143         Iterate the list of bugs, retrieving information from Bugzilla and modifying them.
144 
145         Iterate the given list of bugs associated with the given update. For each bug, retrieve
146         details from Bugzilla, comment on the bug to let watchers know about the update, and mark
147         the bug as MODIFIED. If the bug is a security issue, mark the update as a security update.
148 
149         If handle_bugs is not True, return and do nothing.
150 
151         Args:
152             session (sqlalchemy.orm.session.Session): A database session.
153             update (bodhi.server.models.Update): The update that the bugs are associated with.
154             bugs (list): A list of bodhi.server.models.Bug instances that we wish to act on.
155         """
156         if not self.handle_bugs:
157             log.warning("Not configured to handle bugs")
158             return
159 
160         log.info("Got %i bugs to sync for %r" % (len(bugs), update.alias))
161         for bug in bugs:
162             log.info("Getting RHBZ bug %r" % bug.bug_id)
163             try:
164                 rhbz_bug = bug_module.bugtracker.getbug(bug.bug_id)
165 
166                 log.info("Updating our details for %r" % bug.bug_id)
167                 bug.update_details(rhbz_bug)
168                 log.info("  Got title %r for %r" % (bug.title, bug.bug_id))
169 
170                 # If you set the type of your update to 'enhancement' but you
171                 # attach a security bug, we automatically change the type of your
172                 # update to 'security'. We need to do this first, so we don't
173                 # accidentally comment on stuff that we shouldn't.
174                 if bug.security:
175                     log.info("Setting our UpdateType to security.")
176                     update.type = UpdateType.security
177 
178                 log.info("Commenting on %r" % bug.bug_id)
179                 comment = config['initial_bug_msg'] % (
180                     update.alias, update.release.long_name, update.abs_url())
181 
182                 log.info("Modifying %r" % bug.bug_id)
183                 bug.modified(update, comment)
184             except Exception:
185                 log.warning('Error occurred during updating single bug', exc_info=True)
186
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/bodhi/server/tasks/updates.py b/bodhi/server/tasks/updates.py
--- a/bodhi/server/tasks/updates.py
+++ b/bodhi/server/tasks/updates.py
@@ -36,10 +36,12 @@
 import logging
 import time
 
+from sqlalchemy import func
+
 from bodhi.server import util, bugs as bug_module
 from bodhi.server.config import config
 from bodhi.server.exceptions import BodhiException
-from bodhi.server.models import Bug, Update, UpdateType
+from bodhi.server.models import Bug, Update, UpdateType, UpdateStatus
 
 
 log = logging.getLogger('bodhi')
@@ -95,6 +97,19 @@
 
             bugs = []
             if action == "edit":
+                # If editing a Pending update, all of whose builds are signed, for a release
+                # which isn't composed by Bodhi (i.e. Rawhide), move it directly to Testing.
+                if not update.release.composed_by_bodhi \
+                        and update.status == UpdateStatus.pending \
+                        and update.signed:
+                    log.info("Every build in the update is signed, set status to testing")
+
+                    update.status = UpdateStatus.testing
+                    update.date_testing = func.current_timestamp()
+                    update.request = None
+
+                    log.info(f"Update status of {update.display_name} has been set to testing")
+
                 for idx in data['new_bugs']:
                     bug = Bug.get(idx)

{"golden_diff": "diff --git a/bodhi/server/tasks/updates.py b/bodhi/server/tasks/updates.py\n--- a/bodhi/server/tasks/updates.py\n+++ b/bodhi/server/tasks/updates.py\n@@ -36,10 +36,12 @@\n import logging\n import time\n \n+from sqlalchemy import func\n+\n from bodhi.server import util, bugs as bug_module\n from bodhi.server.config import config\n from bodhi.server.exceptions import BodhiException\n-from bodhi.server.models import Bug, Update, UpdateType\n+from bodhi.server.models import Bug, Update, UpdateType, UpdateStatus\n \n \n log = logging.getLogger('bodhi')\n@@ -95,6 +97,19 @@\n \n             bugs = []\n             if action == \"edit\":\n+                # If editing a Pending update, all of whose builds are signed, for a release\n+                # which isn't composed by Bodhi (i.e. Rawhide), move it directly to Testing.\n+                if not update.release.composed_by_bodhi \\\n+                        and update.status == UpdateStatus.pending \\\n+                        and update.signed:\n+                    log.info(\"Every build in the update is signed, set status to testing\")\n+\n+                    update.status = UpdateStatus.testing\n+                    update.date_testing = func.current_timestamp()\n+                    update.request = None\n+\n+                    log.info(f\"Update status of {update.display_name} has been set to testing\")\n+\n                 for idx in data['new_bugs']:\n                     bug = Bug.get(idx)\n", "issue": "Reset multi builds update that failed merging a side tag to pending\nIf a multi builds update fails to be merge in stable, the approve testing cron job will add a new comment to the update every times it run.\r\nTo avoid this we need to reset the update status to pending, but we also need to be able to move back the update to testing when the update is edited (build added or build removed).\n", "before_files": [{"content": "# Copyright 2015-2019 Red Hat Inc., and others.\n#\n# This file is part of Bodhi.\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License along with\n# this program; if not, write to the Free Software Foundation, Inc., 51\n# Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\"\"\"\nThe \"updates handler\".\n\nThis module is responsible for doing value-added work \"offline\" that used to be\ndone when updates were submitted.  Specifically, when someone submits an update\nwe used to:\n\n- Update any bugs in bugzilla associated with the update.\n- Check for test cases in the wiki.\n\nThose things could sometimes take a *very* long time, especially if there were\nlots of builds and lots of bugs in the update.\n\nNow, update-submission breezes by those steps and simply tells the user \"OK\".\nA message gets published when their update goes through, and *that* message\ngets received here and triggers us to do all that network-laden heavy lifting.\n\"\"\"\n\nimport logging\nimport time\n\nfrom bodhi.server import util, bugs as bug_module\nfrom bodhi.server.config import config\nfrom bodhi.server.exceptions import BodhiException\nfrom bodhi.server.models import Bug, Update, UpdateType\n\n\nlog = logging.getLogger('bodhi')\n\n\nclass UpdatesHandler:\n    \"\"\"\n    Perform background tasks when updates are created or edited.\n\n    This Celery task is run when an update is created or editied in the frontend,\n    and performs background tasks such as modifying Bugzilla issues (and loading information from\n    Bugzilla so we can display it to the user) and looking up wiki test cases.\n\n    Attributes:\n        db_factory (bodhi.server.util.TransactionalSessionMaker): A context manager that yields a\n            database session.\n        handle_bugs (bool): If True, interact with Bugzilla. Else do not.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Initialize the UpdatesHandler.\"\"\"\n        self.db_factory = util.transactional_session_maker()\n\n        self.handle_bugs = bool(config.get('bodhi_email'))\n        if not self.handle_bugs:\n            log.warning(\"No bodhi_email defined; not fetching bug details\")\n\n    def run(self, api_version: int, data: dict):\n        \"\"\"\n        Process the given message, updating relevant bugs and test cases.\n\n        Duplicate messages: if the server delivers the message multiple times,\n        the bugs and test cases are simply re-fetched and updated, so nothing\n        bad happens.\n\n        Args:\n            api_version: API version number.\n            data: Information about a new or edited update.\n        \"\"\"\n        action = data[\"action\"]\n        alias = data['update'].get('alias')\n\n        log.info(\"Updates Handler handling  %s, %s\" % (alias, action))\n\n        # Go to sleep for a second to try and avoid a race condition\n        # https://github.com/fedora-infra/bodhi/issues/458\n        time.sleep(1)\n\n        with self.db_factory() as session:\n            update = Update.get(alias)\n            if not update:\n                raise BodhiException(\"Couldn't find alias '%s' in DB\" % alias)\n\n            bugs = []\n            if action == \"edit\":\n                for idx in data['new_bugs']:\n                    bug = Bug.get(idx)\n\n                    # Sanity check\n                    if bug is None or bug not in update.bugs:\n                        update_bugs_ids = [b.bug_id for b in update.bugs]\n                        update.update_bugs(update_bugs_ids + [idx], session)\n\n                        # Now, after update.update_bugs, bug with idx should exists in DB\n                        bug = Bug.get(idx)\n\n                    bugs.append(bug)\n\n            elif action == \"testing\":\n                bugs = update.bugs\n            else:\n                raise NotImplementedError(\"Should never get here.\")\n\n            self.work_on_bugs(session, update, bugs)\n            self.fetch_test_cases(session, update)\n\n        if config['test_gating.required']:\n            with self.db_factory() as session:\n                update = Update.get(alias)\n                update.update_test_gating_status()\n\n        log.info(\"Updates Handler done with %s, %s\" % (alias, action))\n\n    def fetch_test_cases(self, session, update):\n        \"\"\"\n        Query the wiki for test cases for each package on the given update.\n\n        Args:\n            session (sqlalchemy.orm.session.Session): A database session.\n            update (bodhi.server.models.Update): The update's builds are iterated upon to find test\n                cases for their associated Packages..\n        \"\"\"\n        for build in update.builds:\n            try:\n                build.package.fetch_test_cases(session)\n            except BodhiException:\n                log.warning('Error occurred during fetching testcases', exc_info=True)\n\n    def work_on_bugs(self, session, update, bugs):\n        \"\"\"\n        Iterate the list of bugs, retrieving information from Bugzilla and modifying them.\n\n        Iterate the given list of bugs associated with the given update. For each bug, retrieve\n        details from Bugzilla, comment on the bug to let watchers know about the update, and mark\n        the bug as MODIFIED. If the bug is a security issue, mark the update as a security update.\n\n        If handle_bugs is not True, return and do nothing.\n\n        Args:\n            session (sqlalchemy.orm.session.Session): A database session.\n            update (bodhi.server.models.Update): The update that the bugs are associated with.\n            bugs (list): A list of bodhi.server.models.Bug instances that we wish to act on.\n        \"\"\"\n        if not self.handle_bugs:\n            log.warning(\"Not configured to handle bugs\")\n            return\n\n        log.info(\"Got %i bugs to sync for %r\" % (len(bugs), update.alias))\n        for bug in bugs:\n            log.info(\"Getting RHBZ bug %r\" % bug.bug_id)\n            try:\n                rhbz_bug = bug_module.bugtracker.getbug(bug.bug_id)\n\n                log.info(\"Updating our details for %r\" % bug.bug_id)\n                bug.update_details(rhbz_bug)\n                log.info(\"  Got title %r for %r\" % (bug.title, bug.bug_id))\n\n                # If you set the type of your update to 'enhancement' but you\n                # attach a security bug, we automatically change the type of your\n                # update to 'security'. We need to do this first, so we don't\n                # accidentally comment on stuff that we shouldn't.\n                if bug.security:\n                    log.info(\"Setting our UpdateType to security.\")\n                    update.type = UpdateType.security\n\n                log.info(\"Commenting on %r\" % bug.bug_id)\n                comment = config['initial_bug_msg'] % (\n                    update.alias, update.release.long_name, update.abs_url())\n\n                log.info(\"Modifying %r\" % bug.bug_id)\n                bug.modified(update, comment)\n            except Exception:\n                log.warning('Error occurred during updating single bug', exc_info=True)\n", "path": "bodhi/server/tasks/updates.py"}], "after_files": [{"content": "# Copyright 2015-2019 Red Hat Inc., and others.\n#\n# This file is part of Bodhi.\n#\n# This program is free software; you can redistribute it and/or\n# modify it under the terms of the GNU General Public License\n# as published by the Free Software Foundation; either version 2\n# of the License, or (at your option) any later version.\n#\n# This program is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License along with\n# this program; if not, write to the Free Software Foundation, Inc., 51\n# Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n\"\"\"\nThe \"updates handler\".\n\nThis module is responsible for doing value-added work \"offline\" that used to be\ndone when updates were submitted.  Specifically, when someone submits an update\nwe used to:\n\n- Update any bugs in bugzilla associated with the update.\n- Check for test cases in the wiki.\n\nThose things could sometimes take a *very* long time, especially if there were\nlots of builds and lots of bugs in the update.\n\nNow, update-submission breezes by those steps and simply tells the user \"OK\".\nA message gets published when their update goes through, and *that* message\ngets received here and triggers us to do all that network-laden heavy lifting.\n\"\"\"\n\nimport logging\nimport time\n\nfrom sqlalchemy import func\n\nfrom bodhi.server import util, bugs as bug_module\nfrom bodhi.server.config import config\nfrom bodhi.server.exceptions import BodhiException\nfrom bodhi.server.models import Bug, Update, UpdateType, UpdateStatus\n\n\nlog = logging.getLogger('bodhi')\n\n\nclass UpdatesHandler:\n    \"\"\"\n    Perform background tasks when updates are created or edited.\n\n    This Celery task is run when an update is created or editied in the frontend,\n    and performs background tasks such as modifying Bugzilla issues (and loading information from\n    Bugzilla so we can display it to the user) and looking up wiki test cases.\n\n    Attributes:\n        db_factory (bodhi.server.util.TransactionalSessionMaker): A context manager that yields a\n            database session.\n        handle_bugs (bool): If True, interact with Bugzilla. Else do not.\n    \"\"\"\n\n    def __init__(self, *args, **kwargs):\n        \"\"\"Initialize the UpdatesHandler.\"\"\"\n        self.db_factory = util.transactional_session_maker()\n\n        self.handle_bugs = bool(config.get('bodhi_email'))\n        if not self.handle_bugs:\n            log.warning(\"No bodhi_email defined; not fetching bug details\")\n\n    def run(self, api_version: int, data: dict):\n        \"\"\"\n        Process the given message, updating relevant bugs and test cases.\n\n        Duplicate messages: if the server delivers the message multiple times,\n        the bugs and test cases are simply re-fetched and updated, so nothing\n        bad happens.\n\n        Args:\n            api_version: API version number.\n            data: Information about a new or edited update.\n        \"\"\"\n        action = data[\"action\"]\n        alias = data['update'].get('alias')\n\n        log.info(\"Updates Handler handling  %s, %s\" % (alias, action))\n\n        # Go to sleep for a second to try and avoid a race condition\n        # https://github.com/fedora-infra/bodhi/issues/458\n        time.sleep(1)\n\n        with self.db_factory() as session:\n            update = Update.get(alias)\n            if not update:\n                raise BodhiException(\"Couldn't find alias '%s' in DB\" % alias)\n\n            bugs = []\n            if action == \"edit\":\n                # If editing a Pending update, all of whose builds are signed, for a release\n                # which isn't composed by Bodhi (i.e. Rawhide), move it directly to Testing.\n                if not update.release.composed_by_bodhi \\\n                        and update.status == UpdateStatus.pending \\\n                        and update.signed:\n                    log.info(\"Every build in the update is signed, set status to testing\")\n\n                    update.status = UpdateStatus.testing\n                    update.date_testing = func.current_timestamp()\n                    update.request = None\n\n                    log.info(f\"Update status of {update.display_name} has been set to testing\")\n\n                for idx in data['new_bugs']:\n                    bug = Bug.get(idx)\n\n                    # Sanity check\n                    if bug is None or bug not in update.bugs:\n                        update_bugs_ids = [b.bug_id for b in update.bugs]\n                        update.update_bugs(update_bugs_ids + [idx], session)\n\n                        # Now, after update.update_bugs, bug with idx should exists in DB\n                        bug = Bug.get(idx)\n\n                    bugs.append(bug)\n\n            elif action == \"testing\":\n                bugs = update.bugs\n            else:\n                raise NotImplementedError(\"Should never get here.\")\n\n            self.work_on_bugs(session, update, bugs)\n            self.fetch_test_cases(session, update)\n\n        if config['test_gating.required']:\n            with self.db_factory() as session:\n                update = Update.get(alias)\n                update.update_test_gating_status()\n\n        log.info(\"Updates Handler done with %s, %s\" % (alias, action))\n\n    def fetch_test_cases(self, session, update):\n        \"\"\"\n        Query the wiki for test cases for each package on the given update.\n\n        Args:\n            session (sqlalchemy.orm.session.Session): A database session.\n            update (bodhi.server.models.Update): The update's builds are iterated upon to find test\n                cases for their associated Packages..\n        \"\"\"\n        for build in update.builds:\n            try:\n                build.package.fetch_test_cases(session)\n            except BodhiException:\n                log.warning('Error occurred during fetching testcases', exc_info=True)\n\n    def work_on_bugs(self, session, update, bugs):\n        \"\"\"\n        Iterate the list of bugs, retrieving information from Bugzilla and modifying them.\n\n        Iterate the given list of bugs associated with the given update. For each bug, retrieve\n        details from Bugzilla, comment on the bug to let watchers know about the update, and mark\n        the bug as MODIFIED. If the bug is a security issue, mark the update as a security update.\n\n        If handle_bugs is not True, return and do nothing.\n\n        Args:\n            session (sqlalchemy.orm.session.Session): A database session.\n            update (bodhi.server.models.Update): The update that the bugs are associated with.\n            bugs (list): A list of bodhi.server.models.Bug instances that we wish to act on.\n        \"\"\"\n        if not self.handle_bugs:\n            log.warning(\"Not configured to handle bugs\")\n            return\n\n        log.info(\"Got %i bugs to sync for %r\" % (len(bugs), update.alias))\n        for bug in bugs:\n            log.info(\"Getting RHBZ bug %r\" % bug.bug_id)\n            try:\n                rhbz_bug = bug_module.bugtracker.getbug(bug.bug_id)\n\n                log.info(\"Updating our details for %r\" % bug.bug_id)\n                bug.update_details(rhbz_bug)\n                log.info(\"  Got title %r for %r\" % (bug.title, bug.bug_id))\n\n                # If you set the type of your update to 'enhancement' but you\n                # attach a security bug, we automatically change the type of your\n                # update to 'security'. We need to do this first, so we don't\n                # accidentally comment on stuff that we shouldn't.\n                if bug.security:\n                    log.info(\"Setting our UpdateType to security.\")\n                    update.type = UpdateType.security\n\n                log.info(\"Commenting on %r\" % bug.bug_id)\n                comment = config['initial_bug_msg'] % (\n                    update.alias, update.release.long_name, update.abs_url())\n\n                log.info(\"Modifying %r\" % bug.bug_id)\n                bug.modified(update, comment)\n            except Exception:\n                log.warning('Error occurred during updating single bug', exc_info=True)\n", "path": "bodhi/server/tasks/updates.py"}]}