Hi!
Actually in cli.py, optparse.OptionParser.format_usage() is being used
to display the help message but there in no function format_usage() (at
least on my system and I also tried searching on docs.python.org).
format_help() is the function we should be using. Patch is attached.
Kulbir Saini wrote:
Hi all!
Yum shell seems to be broken in latest code. Shell is not able to
process any command which is not valid. e.g. if I type 'repolist' on yum
shell it works as expected but if I type 'help' it breaks. Output with
debuglevel=7 is below.
[EMAIL PROTECTED] yum]# ./yummain.py shell
Loading "basearchonly" plugin
Loading "installonlyn" plugin
Loaded plugins: basearchonly, installonlyn
Running "config" handler for "installonlyn" plugin
Config time: 0.128
Yum Version: 3.2.14
COMMAND: yum shell
Installroot: /
No argument to shell
Setting up Yum Shell
> repolist
Yum Version: 3.2.14
COMMAND: repolist
Installroot: /
Repo-id : iiit-yum-all-arch
Repo-name : IIIT iYum Network Repository Fedora All
Repo-enabled: enabled
Repo-id : iiit-yum-all-noarch
Repo-name : IIIT iYum Network Repository Fedora all - Noarch
Repo-enabled: enabled
Repo-id : iiit-yum-core-rel-arch
Repo-name : IIIT iYum Network Repository Fedora Core
Repo-enabled: enabled
Repo-id : iiit-yum-rel-arch
Repo-name : IIIT iYum Network Repository
Repo-enabled: enabled
Repo-id : iiit-yum-rel-noarch
Repo-name : IIIT iYum Network Repository Noarch
Repo-enabled: enabled
> help
Traceback (most recent call last):
File "./yummain.py", line 248, in <module>
user_main(sys.argv[1:], exit_code=True)
File "./yummain.py", line 241, in user_main
errcode = main(args)
File "./yummain.py", line 116, in main
result, resultmsgs = base.doCommands()
File "/home2/Studies/project/btp/Yum/yum/cli.py", line 311, in doCommands
return self.yum_cli_commands[self.basecmd].doCommand(self,
self.basecmd, self.extcmds)
File "/home2/Studies/project/btp/Yum/yum/yumcommands.py", line 592, in
doCommand
return base.doShell()
File "/home2/Studies/project/btp/Yum/yum/cli.py", line 254, in doShell
yumshell.cmdloop()
File "/usr/lib64/python2.5/cmd.py", line 142, in cmdloop
stop = self.onecmd(line)
File "/usr/lib64/python2.5/cmd.py", line 219, in onecmd
return func(arg)
File "/home2/Studies/project/btp/Yum/yum/shell.py", line 148, in do_help
self.base.shellUsage()
File "/home2/Studies/project/btp/Yum/yum/cli.py", line 906, in shellUsage
sys.stdout.write(self.optparser.format_usage())
AttributeError: YumOptionParser instance has no attribute 'format_usage'
[EMAIL PROTECTED] yum]#
--
---------------------------------------------------
Thank you,
Kulbir Saini,
Computer Science and Engineering,
International Institute of Information Technology,
Hyderbad, India - 500032.
My Home-Page: http://saini.co.in/
My Institute: http://www.iiit.ac.in/
My Linux-Blog: http://fedora.co.in/
IRC nick : generalBordeaux
Channels : #fedora, #fedora-devel, #yum on freenode
diff --git a/cli.py b/cli.py
index 46a5a8e..155b56f 100644
--- a/cli.py
+++ b/cli.py
@@ -903,7 +903,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
def shellUsage(self):
''' Print out the shell usage '''
- sys.stdout.write(self.optparser.format_usage())
+ sys.stdout.write(self.optparser.format_help())
def _installable(self, pkg, ematch=False):
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel