upgrades-migrations / redhat-upgrade-tool

Upgrades Red Hat Enterprise Linux from one major version to a newer one. Disclaimer: It was fun. R.I.P. :-)
GNU General Public License v2.0
15 stars 17 forks source link

Stop executing when .treeinfo not available #24

Closed bocekm closed 7 years ago

bocekm commented 7 years ago

When .treeinfo or treeinfo was not available, the Red Hat Upgrade Tool ended later on with an unrelated error, for example:

redhat_upgrade_tool.yum ERROR: Error downloading .treeinfo or treeinfofrom repo cmdline-instrepo: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Traceback (most recent call last):
  File "/usr/bin/redhat-upgrade-tool", line 448, in <module>
    main(args)
  File "/usr/bin/redhat-upgrade-tool", line 164, in main
    if f.treeinfo.get('general', 'version').split('.')[0] != \
  File "/usr/lib/python2.6/site-packages/redhat_upgrade_tool/download.py", line 425, in treeinfo
    self._treeinfo.checkvalues()
  File "/usr/lib/python2.6/site-packages/redhat_upgrade_tool/treeinfo.py", line 186, in checkvalues
    self.get('general', f)
  File "/usr/lib64/python2.6/ConfigParser.py", line 321, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'general'

Now the utility stops it's execution right away and the error message specifies the repository URL, not just its internal ID (cmdline-instrepo):

redhat_upgrade_tool.yum ERROR: Error downloading .treeinfo or treeinfo from repo http://download.eng.brq.redhat.com/scratch/mbocek/dotless_treeinfo_repo/: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

This fix was inspired by rhbz#1486439.

pkotvan commented 7 years ago

Do I understand it correctly, that the treeinfo is missing from target repository provided for upgrade? If yes, this should be easy to reproduce/verify. Just need to delete treeinfo from repository used for upgrade.

bocekm commented 7 years ago

@pkotvan, yes, to verify it, just delete the .treeinfo from the repo. Before, when the .treeinfo (or treeinfo) was missing in the repo, the tool provided an error message about that but went on with the execution and failed later on with another, unrelated error message.

pkotvan commented 7 years ago

@bocekm Thanks for clarification. I was able to verify the fix in this pull request. Setting as verified.