diff --git a/bodhi/server/consumers/masher.py b/bodhi/server/consumers/masher.py index 1ac07d66ed..c9419e6d80 100644 --- a/bodhi/server/consumers/masher.py +++ b/bodhi/server/consumers/masher.py @@ -1325,11 +1325,11 @@ def _wait_for_sync(self): try: self.log.info('Polling %s' % master_repomd_url) masterrepomd = urllib2.urlopen(master_repomd_url) + newsum = hashlib.sha1(masterrepomd.read()).hexdigest() except (IncompleteRead, URLError, HTTPError): self.log.exception('Error fetching repomd.xml') time.sleep(200) continue - newsum = hashlib.sha1(masterrepomd.read()).hexdigest() if newsum == checksum: self.log.info("master repomd.xml matches!") notifications.publish( diff --git a/bodhi/tests/server/consumers/test_masher.py b/bodhi/tests/server/consumers/test_masher.py index 2261964316..96792eae51 100644 --- a/bodhi/tests/server/consumers/test_masher.py +++ b/bodhi/tests/server/consumers/test_masher.py @@ -3105,9 +3105,7 @@ def test_incompleteread(self, urlopen, sleep, publish, save): """ Assert that an IncompleteRead is properly caught and logged, and that the code continues. """ - fake_url = mock.MagicMock() - fake_url.read.return_value = b'---\nyaml: rules' - urlopen.side_effect = [IncompleteRead('some_data'), fake_url] + urlopen.return_value.read.side_effect = [IncompleteRead('some_data'), b'---\nyaml: rules'] t = PungiComposerThread(self.semmock, self._make_msg()['body']['msg']['composes'][0], 'bowlofeggs', log, self.Session, self.tempdir) t.compose = self.db.query(Compose).one() @@ -3132,10 +3130,12 @@ def test_incompleteread(self, urlopen, sleep, publish, save): # won't be deterministic about which of arch URL gets used. However, either one of them # would be correct so we will just assert that the one that is used is used correctly. arch = 'x86_64' if 'x86_64' in urlopen.mock_calls[0][1][0] else 'aarch64' - expected_calls = [ - mock.call('http://example.com/pub/fedora/linux/updates/testing/17/' - '{}/repodata.repomd.xml'.format(arch)) - for i in range(2)] + expected_calls = [] + for i in range(2): + expected_calls.append( + mock.call('http://example.com/pub/fedora/linux/updates/testing/17/' + '{}/repodata.repomd.xml'.format(arch))) + expected_calls.append(mock.call().read()) urlopen.assert_has_calls(expected_calls) t.log.exception.assert_called_once_with('Error fetching repomd.xml') sleep.assert_called_once_with(200) diff --git a/docs/conf.py b/docs/conf.py index 4058153c32..cd218b1b53 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -63,7 +63,7 @@ # The short X.Y version. version = '3.11' # The full version, including alpha/beta/rc tags. -release = '3.11.1' +release = '3.11.2' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/docs/user/release_notes.rst b/docs/user/release_notes.rst index 9d2cc3d570..0ee38bbe36 100644 --- a/docs/user/release_notes.rst +++ b/docs/user/release_notes.rst @@ -2,6 +2,32 @@ Release notes ============= +v3.11.2 +------- + +This is a bugfix release, addressing an issue that was solved incorrectly with 3.11.1. + + +Server upgrade instructions +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +No special actions are needed when applying this update. + + +Bug fixes +^^^^^^^^^ + +* Correctly catch ``http.client.IncompleteRead`` while Composing and retry (:issue:`2758`). + + +Contributors +^^^^^^^^^^^^ + +The following developers contributed to Bodhi 3.11.2: + +* Randy Barlow + + v3.11.1 ------- diff --git a/setup.py b/setup.py index 9b52b64e50..12ea1e64d2 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def get_requirements(requirements_file='requirements.txt'): here = os.path.abspath(os.path.dirname(__file__)) README = open(os.path.join(here, 'README.rst')).read() -VERSION = '3.11.1' +VERSION = '3.11.2' # Possible options are at https://pypi.python.org/pypi?%3Aaction=list_classifiers CLASSIFIERS = [ 'Development Status :: 5 - Production/Stable',