Skip to content

Commit

Permalink
Fix repomd.xml parsing with an empty revision tag
Browse files Browse the repository at this point in the history
The NSA SIMP 5.1.X repodata contains a <revision /> tag which busts sync
with the following splat:

 Downloading metadata from https://dl.bintray.com/simp/5.1.X/.
 Starting new HTTPS connection (1): dl.bintray.com
 Parsing metadata.
  sync failed
  Traceback (most recent call last):
    File ".../sync.py", line 142, in run
      metadata_files = self.get_metadata()
    File ".../sync.py", line 226, in get_metadata
      metadata_files.parse_repomd()
    File ".../metadata.py", line 165, in parse_repomd
      self.revision = int(element.text)
  TypeError: int() argument must be a string or a number, not 'NoneType'

closes #710
https://pulp.plan.io/issues/1263
  • Loading branch information
roysjosh committed Sep 21, 2015
1 parent 108bbce commit 54c8837
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/pulp_rpm/plugins/importers/yum/repomd/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def parse_repomd(self):
if element.tag == REVISION_TAG:
try:
self.revision = int(element.text)
except ValueError:
except (TypeError, ValueError):
_LOGGER.info('repository revision is not an integer. '
'unable to consider skipping steps.')
self.revision = 0
Expand Down

0 comments on commit 54c8837

Please sign in to comment.