Bug 14143 - samba-tool testparm --section bombs out python errors
Summary: samba-tool testparm --section bombs out python errors
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.8.12
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 13:58 UTC by Marco Gaiarin
Modified: 2020-05-29 07:49 UTC (History)
0 users

See Also:


Attachments
Samba current config file. (3.15 KB, text/plain)
2019-09-26 13:58 UTC, Marco Gaiarin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Gaiarin 2019-09-26 13:58:25 UTC
Created attachment 15494 [details]
Samba current config file.

root@vdmsv1:~# samba-tool testparm --section users
ERROR(<type 'exceptions.TypeError'>): uncaught exception - 
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 177, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/testparm.py", line 105, in run
    lp[section_name].dump(verbose)

but, if i ask also a parameter:

root@vdmsv1:~# samba-tool testparm --section-name=users --parameter-name=path
/home

'samba-tool testparm' works as expected. smb.conf file attached.
Comment 1 Hezekiah 2020-05-28 19:12:09 UTC
(In reply to Marco Gaiarin from comment #0)

In the first command the flag --section does not exist in samba-tool.
You can try samba-tool testparm --section-name=users
Comment 2 Marco Gaiarin 2020-05-29 07:49:13 UTC
Ahem, probably a cut&paste error, sorry. Done now:

root@vdmsv1:~# samba-tool testparm --section-name=users
ERROR(<type 'exceptions.TypeError'>): uncaught exception - 
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 177, in _run
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/samba/netcmd/testparm.py", line 105, in run
    lp[section_name].dump(verbose)

root@vdmsv1:~# samba-tool testparm --section-name=users --parameter-name=path
/home

root@vdmsv1:~# dpkg -l | grep samba
ii  python-samba                       2:4.8.12-1~deb9                    amd64        Python bindings for Samba
ii  samba                              2:4.8.12-1~deb9                    amd64        SMB/CIFS file, print, and login server for Unix
ii  samba-common                       2:4.8.12-1~deb9                    all          common files used by both the Samba server and client
ii  samba-common-bin                   2:4.8.12-1~deb9                    amd64        Samba common files used by both the server and the client
ii  samba-dsdb-modules:amd64           2:4.8.12-1~deb9                    amd64        Samba Directory Services Database
ii  samba-libs:amd64                   2:4.8.12-1~deb9                    amd64        Samba core libraries
ii  samba-vfs-modules:amd64            2:4.8.12-1~deb9                    amd64        Samba Virtual FileSystem plugins