Bug 9914 - Traceback whild parsing command line options
Traceback whild parsing command line options
Status: CLOSED WORKSFORME
Product: UCS
Classification: Unclassified
Component: UCR
UCS 3.0
All Linux
: P4 minor (vote)
: UCS 3.2
Assigned To: Philipp Hahn
Felix Botner
: interim-2
: 15969 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-11-26 13:38 CET by Moritz Muehlenhoff
Modified: 2013-11-19 06:44 CET (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted after Product Owner Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Muehlenhoff univentionstaff 2007-11-26 13:38:12 CET
Ruft man univention-config-registry mit der Option --keys-only ohne Angabe der Unterkommandos "search" oder "dump" auf, so erscheint folgender Traceback, der stattdessen besser die Usage-Informationen anzeigen sollte:

root@master:~# univention-config-registry --keys-only
Traceback (most recent call last):
  File "/usr/sbin/univention-config-registry", line 40, in ?
    ub.main(sys.argv[1:])
  File "/usr/lib/python2.4/site-packages/univention/config_registry.py", line 1081, in main
    action = args[ 0 ]
IndexError: list index out of range
root@master:~#
Comment 1 Moritz Muehlenhoff univentionstaff 2011-12-16 12:15:44 CET
Das Options-Parsing sollte auf das optparse-Modul aus Python umgestellt werden.
Comment 2 Moritz Muehlenhoff univentionstaff 2011-12-16 12:16:30 CET
Ein weiterer Bug:

root@master:~# ucr --shell
Traceback (most recent call last):
  File "/usr/sbin/ucr", line 65, in <module>
    ub.main(convertToUtf8(sys.argv[1:]))
  File "/usr/lib/pymodules/python2.6/univention/config_registry.py", line 1620, in main
    action = args[ 0 ]
IndexError: list index out of range
Comment 3 Moritz Muehlenhoff univentionstaff 2011-12-16 12:16:39 CET
*** Bug 15969 has been marked as a duplicate of this bug. ***
Comment 4 Moritz Muehlenhoff univentionstaff 2011-12-16 15:18:13 CET
(In reply to comment #1)
> Das Options-Parsing sollte auf das optparse-Modul aus Python umgestellt werden.

Das würde auch Bug 22229 lösen.
Comment 5 Philipp Hahn univentionstaff 2013-09-20 10:43:05 CEST
(In reply to Moritz Muehlenhoff from comment #0)
> root@master:~# univention-config-registry --keys-only
# univention-config-registry --keys-only
E: missing action, see --help

(In reply to Moritz Muehlenhoff from comment #2)
> root@master:~# ucr --shell
# ucr --shell
E: missing action, see --help

(In reply to Moritz Muehlenhoff from comment #1)
> Das Options-Parsing sollte auf das optparse-Modul aus Python umgestellt
> werden.

optparse can't handle the subcommands of ucr, while <http://docs.python.org/2.7/library/argparse.html> is only available since Python 2.7 or as a separate Debian package.
If I remember correctly I tried to change UCR to OptionParser once, but had to revert the change because it subtly broke the API of UCR.

I'm closing this bug, as the original two tracebacks are WORKS-FOR-ME by now.
For the switch-over to OptionParser a separate bug tagged as API-change should be cloned (if this is still desired).
Comment 6 Felix Botner univentionstaff 2013-09-20 10:57:29 CEST
OK 

-> ucr --shell
E: missing action, see --help
-> univention-config-registry --keys-only
E: missing action, see --help
Comment 7 Stefan Gohmann univentionstaff 2013-11-19 06:44:30 CET
UCS 3.2 has been released:
 http://docs.univention.de/release-notes-3.2-en.html
 http://docs.univention.de/release-notes-3.2-de.html

If this error occurs again, please use "Clone This Bug".