Bug 994344 - Display appropriate message when used unsupported files in rct cat-manifest/dump-manifest command
Display appropriate message when used unsupported files in rct cat-manifest/d...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Carter Kozak
John Sefler
Depends On:
Blocks: rhsm-rhel65
  Show dependency treegraph
Reported: 2013-08-07 01:42 EDT by Rehana
Modified: 2014-09-14 20:09 EDT (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
No description necessary.
Story Points: ---
Clone Of:
Last Closed: 2013-11-21 16:27:20 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1659 normal SHIPPED_LIVE subscription-manager and python-rhsm bug fix and enhancement update 2013-11-20 16:53:10 EST

  None (edit)
Description Rehana 2013-08-07 01:42:16 EDT
Description of problem:
Observed that cat-manifest works with .zip files (which is correct as desgied), when given other files like .pem in rct cat-manifest command , its throwing Traceback.Logging a bug to catch the Traceback and display a good error message.

Version-Release number of selected component (if applicable):
rpm -qa | grep subs

How reproducible:

Steps to Reproduce:
1.Execute rct cat-manifest with any file(ex:rct cm 2514643273829928242.pem)
2.Execute rct dump-manifest with any file(ex:rct dm 5467644249924152940.pem)

Actual results:
observed the below traceback error
root@rehanatestmachine entitlement]# rct dm 5467644249924152940.pem 
Traceback (most recent call last):
  File "/usr/bin/rct", line 44, in <module>
    sys.exit(abs(main() or 0))
  File "/usr/bin/rct", line 39, in main
    return RctCLI().main()
  File "/usr/share/rhsm/subscription_manager/cli.py", line 166, in main
    return cmd.main()
  File "/usr/share/rhsm/rct/commands.py", line 39, in main
    return_code = self._do_command()
  File "/usr/share/rhsm/rct/manifest_commands.py", line 312, in _do_command
    if self._extract(os.getcwd(), self.options.overwrite_files):
  File "/usr/share/rhsm/rct/manifest_commands.py", line 289, in _extract
    self._extract_manifest(destination, overwrite)
  File "/usr/share/rhsm/rct/manifest_commands.py", line 141, in _extract_manifest
    archive = ZipExtractAll(self._get_file_from_args(), 'r')
  File "/usr/lib64/python2.6/zipfile.py", line 696, in __init__
  File "/usr/lib64/python2.6/zipfile.py", line 716, in _GetContents
  File "/usr/lib64/python2.6/zipfile.py", line 728, in _RealGetContents
    raise BadZipfile, "File is not a zip file"
zipfile.BadZipfile: File is not a zip file

Expected results:
Though the traceback is saying what the problem is, we suggest that it will be good to catch this traceback and display a user friendly message in the console

Additional info:
Comment 2 Carter Kozak 2013-08-28 12:49:40 EDT
commit dad138479c1e34151f29a04d8c1e202c5d0d67ba
Author: ckozak <ckozak@redhat.com>
Date:   Mon Aug 26 13:18:43 2013 -0400

    994344: messaging for bad filetypes
Comment 4 John Sefler 2013-09-15 14:37:35 EDT
Verifying Version...
[root@jsefler-6 ~]# rpm -q subscription-manager

[root@jsefler-6 ~]# rct cat-manifest /etc/pki/product/69.pem 
Manifest zip is invalid.
[root@jsefler-6 ~]# rct dump-manifest /etc/pki/product/69.pem 
Manifest zip is invalid.

VERIFIED: The former Traceback is now caught and "Manifest zip is invalid." is now printed to stdout.
Comment 5 errata-xmlrpc 2013-11-21 16:27:20 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.