Bug 9373 - Output of 'samba-tool' does not look very nice
Summary: Output of 'samba-tool' does not look very nice
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Python (show other bugs)
Version: 4.0.0rc4
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-09 08:50 UTC by Karolin Seeger
Modified: 2012-11-27 08:08 UTC (History)
1 user (show)

See Also:


Attachments
Prosposed patches done by Metze (2.85 KB, patch)
2012-11-09 08:50 UTC, Karolin Seeger
metze: review-
Details
Additional patch to fix typo in samba-tool --help (1.21 KB, patch)
2012-11-09 08:57 UTC, Karolin Seeger
vl: review+
Details
Patch for v4-0-test (1.22 KB, patch)
2012-11-15 09:45 UTC, Stefan Metzmacher
metze: review? (abartlet)
obnox: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karolin Seeger 2012-11-09 08:50:13 UTC
Created attachment 8172 [details]
Prosposed patches done by Metze

When specifying unknown options or passing a non-existing filename, 'samba-tool' displays a stacktrace:

user@host:/data/git/samba/master> ./bin/samba-tool testparm -s bla
ERROR(runtime): uncaught exception - Unable to load file bla
  File "bin/python/samba/netcmd/__init__.py", line 175, in _run
    return self.run(*args, **kwargs)
  File "bin/python/samba/netcmd/testparm.py", line 85, in run
    lp = sambaopts.get_loadparm()
  File "bin/python/samba/getopt.py", line 88, in get_loadparm
    self._lp.load(self._configfile)

A shorter message would be more useful for users.
Comment 1 Karolin Seeger 2012-11-09 08:51:51 UTC
These patches fix the issue for me:

user@host:/data/git/samba/master> ./bin/samba-tool testparm -s bla                                                                                                         
ERROR(runtime): uncaught exception - Unable to load file bla
Comment 2 Karolin Seeger 2012-11-09 08:56:03 UTC
Patches need to be pushed to master also.
Comment 3 Karolin Seeger 2012-11-09 08:57:58 UTC
Created attachment 8173 [details]
Additional patch to fix typo in samba-tool --help
Comment 4 Karolin Seeger 2012-11-09 10:08:58 UTC
(In reply to comment #3)
> Created attachment 8173 [details]
> Additional patch to fix typo in samba-tool --help

Pushed to master by Volker (76fa5ee5d).
Comment 5 Karolin Seeger 2012-11-09 10:57:13 UTC
(In reply to comment #3)
> Created attachment 8173 [details]
> Additional patch to fix typo in samba-tool --help

Pushed to master by Volker (76fa5ee5d).
Comment 6 Stefan Metzmacher 2012-11-09 14:57:55 UTC
Comment on attachment 8172 [details]
Prosposed patches done by Metze

The first patch is under discussion...

The 2nd one should be ok for master and then 4.0
Comment 7 Karolin Seeger 2012-11-12 08:22:03 UTC
(In reply to comment #6)
> Comment on attachment 8172 [details]
> Prosposed patches done by Metze
> 
> The first patch is under discussion...
> 
> The 2nd one should be ok for master and then 4.0

Pushed second patch to autobuild-v4-0-test.
Comment 8 Karolin Seeger 2012-11-12 10:50:05 UTC
Re-assigning to Metze.
Comment 9 Stefan Metzmacher 2012-11-15 09:45:16 UTC
Created attachment 8200 [details]
Patch for v4-0-test
Comment 10 Michael Adam 2012-11-26 09:42:04 UTC
Comment on attachment 8200 [details]
Patch for v4-0-test

ok
Comment 11 Michael Adam 2012-11-26 09:42:21 UTC
==> Karo
Comment 12 Karolin Seeger 2012-11-26 09:51:29 UTC
Pushed to v4-0-test-autobuild.
Comment 13 Karolin Seeger 2012-11-27 08:08:57 UTC
Pushed to v4-0-test.
Closing out bug report.

Thanks!