Bug 14143 - samba-tool testparm --section bombs out python errors
Summary: samba-tool testparm --section bombs out python errors
Status: RESOLVED FIXED
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: Jo Sutton
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-26 13:58 UTC by Marco Gaiarin
Modified: 2022-09-06 08:01 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
Comment 3 Samba QA Contact 2021-05-17 22:29:04 UTC
This bug was referenced in samba master:

33bb6ad35635590be112e94941dbfc02b4db1d30
e54563861b2b06370fe3a2a10d7e7df2e3e18f24
11f26877ce1849439948c8d1f12dc9dd43cd534d
7d7017b30248c2855248a9bab56fd5b91597686c
Comment 4 Jo Sutton 2022-09-06 08:01:35 UTC
Fixed in Samba 4.15.