Bug 448207

Summary: yum groupinstall traceback if group does'nt exist
Product: [Fedora] Fedora Reporter: Pradeep Kilambi <pkilambi>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 9CC: ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-26 18:19:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pradeep Kilambi 2008-05-24 12:32:50 UTC
Description of problem:

WHen yum group install a misspealt or unknown group its gives a traceback
instead of a proper error message.

  $ sudo yum groupinstall "KDE (K Desktop Environment"Loaded plugins:
fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * google: dl.google.com
 * livna: mirrors.tummy.com
 * fedora: ftp.linux.ncsu.edu
 * adobe-linux-i386: linuxdownload.adobe.com
 * updates: ftp.linux.ncsu.edu
Setting up Group Process
Loading mirror speeds from cached hostfile
 * google: dl.google.com
 * livna: mirrors.tummy.com
 * fedora: ftp.linux.ncsu.edu
 * adobe-linux-i386: linuxdownload.adobe.com
 * updates: ftp.linux.ncsu.edu
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 241, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 116, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 311, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd,
self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 327, in doCommand
    return base.installGroups(extcmds)
  File "/usr/share/yum-cli/cli.py", line 859, in installGroups
    self.logger.error(_('Warning: Group %s does not exist.'), group_strng)
NameError: global name 'group_strng' is not defined

looks like a typo error. 

here is the patch to fix it:
$ diff -u /usr/share/yum-cli/cli.py.orig /usr/share/yum-cli/cli.py 
--- /usr/share/yum-cli/cli.py.orig	2008-05-24 08:29:20.000000000 -0400
+++ /usr/share/yum-cli/cli.py	2008-05-24 08:29:44.000000000 -0400
@@ -856,7 +856,7 @@
                     pkgs_used.extend(txmbrs)
 
             if not group_matched:
-                self.logger.error(_('Warning: Group %s does not exist.'),
group_strng)
+                self.logger.error(_('Warning: Group %s does not exist.'),
group_string)
                 continue
             
         if not pkgs_used:


Applying the patch:

$ sudo yum groupinstall "KDE (K Desktop Environment"Loaded plugins:
fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * google: dl.google.com
 * livna: mirrors.tummy.com
 * fedora: ftp.linux.ncsu.edu
 * adobe-linux-i386: linuxdownload.adobe.com
 * updates: ftp.linux.ncsu.edu
Setting up Group Process
Loading mirror speeds from cached hostfile
 * google: dl.google.com
 * livna: mirrors.tummy.com
 * fedora: ftp.linux.ncsu.edu
 * adobe-linux-i386: linuxdownload.adobe.com
 * updates: ftp.linux.ncsu.edu
Warning: Group KDE (K Desktop Environment does not exist.
No packages in any requested group available to install or update

gives the right message.

Version-Release number of selected component (if applicable):

$ rpm -q yum
yum-3.2.14-10.fc9.noarch

How reproducible:

always

  
Actual results:

traceback

Expected results:

A proper error message

Additional info:

Comment 1 Seth Vidal 2008-05-26 18:19:10 UTC
It's already been fixed in upstream and in the yum in updates-testing.