Description of problem: [whayutin@minidoe tools]$ PYTHONPATH=src/ bin/rhui-manager --config dev/rhui-tools.conf repo info --repo_id 3 rhui-manager throws an ugly exception if bogus data is passed via the command line Traceback (most recent call last): File "bin/rhui-manager", line 16, in <module> rhui.tools.launcher.main() File "/home/whayutin/workspace/cloude/rhui-2.0/tools/src/rhui/tools/launcher.py", line 341, in main cli.run(args) File "/home/whayutin/workspace/cloude/rhui-2.0/tools/src/rhui/common/cli.py", line 277, in run command_or_section.execute(remaining_args) File "/home/whayutin/workspace/cloude/rhui-2.0/tools/src/rhui/common/cli.py", line 118, in execute self.method(**arg_dict) File "/home/whayutin/workspace/cloude/rhui-2.0/tools/src/rhui/tools/commands/repo.py", line 70, in info render.display_repo_details(self.prompt, repo) File "/home/whayutin/workspace/cloude/rhui-2.0/tools/src/rhui/tools/render.py", line 131, in display_repo_details if GROUP_RED_HAT in repo['groupid']: TypeError: 'NoneType' object is not subscriptable
Created attachment 585279 [details] patch to catch invalid repos provided via rhua-manager cli
Created attachment 585293 [details] patch for a cleaner message to users when an invalid repo is passed
[whayutin@minidoe tools]$ PYTHONPATH=src/ bin/rhui-manager --config dev/rhui-tools.conf --debug repo info --repo_id 3 No repositories found This appears to be working w/o changes cloude commit 189483f24a6e6ddf6dabcac65b2f561ad550b11e pulp commit e05ced383504133543ac7b6114b45c98699b6e61 moving to on_qa
cloude commit ede48cd639a19fef3666380eecbf46c7e95a80fd fixed rhui-manager packages list --repo_id
It seems fixes are not merged with the latest version: /root/RHEL-6.3-RHUI-2.1-20120731.0-Server-x86_64-DVD1.iso on /tmp/mnt type iso9660 (rw,loop=/dev/loop0) [root@ip-10-85-5-60 usr]# PYTHONPATH=src/ bin/rhui-manager --config /etc/rhui/rhui-tools.conf repo info --repo_id 3 Traceback (most recent call last): File "bin/rhui-manager", line 16, in <module> rhui.tools.launcher.main() File "/usr/lib/python2.6/site-packages/rhui/tools/launcher.py", line 348, in main cli.run(args) File "/usr/lib/python2.6/site-packages/rhui/common/cli.py", line 272, in run command_or_section.execute(remaining_args) File "/usr/lib/python2.6/site-packages/rhui/common/cli.py", line 113, in execute self.method(**arg_dict) File "/usr/lib/python2.6/site-packages/rhui/tools/commands/repo.py", line 71, in info render.display_repo_details(self.prompt, repo) File "/usr/lib/python2.6/site-packages/rhui/tools/render.py", line 135, in display_repo_details if GROUP_RED_HAT in repo['groupid']: TypeError: 'NoneType' object is unsubscriptable Moving bug to ON_DEV
looks fine in the latest build.. here is a sample plan.. [root@ip-10-70-90-96 ~]# rhui-manager repo list --help Usage: rhui-manager [options] Options: -h, --help show this help message and exit list: lists all repositories in the RHUI [root@ip-10-70-90-96 ~]# rhui-manager repo info info: displays information on an individual repo --repo_id - identifies the repository to display (required) The following options are required but were not specified: --repo_id [root@ip-10-70-90-96 ~]# rhui-manager repo info --repo_id rhel-server-5-5Server-x86_64 Name: Red Hat Enterprise Linux Server 5 (RPMs) (5Server-x86_64) Type: Red Hat Relative Path: content/dist/rhel/rhui/server/5/5Server/x86_64/os Package Count: 13912 Last Sync: 08-01-2012 06:17 Next Sync: 08-01-2012 11:37 [root@ip-10-70-90-96 ~]# rhui-manager repo info --repo_id Usage: rhui-manager [options] info: displays information on an individual repo --repo_id - identifies the repository to display (required) [root@ip-10-70-90-96 ~]#
b3895b0827e5d41d03ee0dcf97e1f50dade492c6 bf882b877d575825307dd21879319e22df045925 k.. this should be fixed for any use case in "repo" and "packages" good catch
VERIFIED against /root/RHEL-6.3-RHUI-2.1-20120801.0-Server-x86_64-DVD1.iso [root@ip-10-46-39-253 ~]# rhui-manager repo info --repo_id doesntexist repository doesntexist was not found [root@ip-10-46-39-253 ~]# rhui-manager packages list --repo_id doesntexist repo_id not found Moving bug to VERIFIED
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: For #rhui-manager repo info, and #rhui-manager packages list, when invalid data is passed, ugly traceback is returned. Patches have been applied to render.py and packages.py so that when invalid data is passed, it only returns repo_id/repository not found.
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. http://rhn.redhat.com/errata/RHEA-2012-1205.html