<feed xmlns='http://www.w3.org/2005/Atom'>
<title>samba.git/python/samba/netcmd/__init__.py, branch master</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/'/>
<entry>
<title>samba-tool: Command.message() can print multiple lines</title>
<updated>2025-08-20T04:34:37+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-08-13T04:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=625cabf65140ee2c79b0a89c483edd071d58a4f4'/>
<id>625cabf65140ee2c79b0a89c483edd071d58a4f4</id>
<content type='text'>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: add verbose flag to @exception_to_command_error</title>
<updated>2025-08-20T04:34:37+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-08-13T22:33:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=7c08990a45540a83695e7759af0c72b77a90c2d5'/>
<id>7c08990a45540a83695e7759af0c72b77a90c2d5</id>
<content type='text'>
Helpful in development.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Helpful in development.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: add decorator to catch exception types</title>
<updated>2025-08-20T04:34:37+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-08-09T04:27:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=2797c013e34953739e761ed56ea30b1f3f6c817d'/>
<id>2797c013e34953739e761ed56ea30b1f3f6c817d</id>
<content type='text'>
Often we [think we] know that all exceptions of a certain type should
be formatted as CommandErrors (i.e., the traceback is suppressed, and
the message is assumed intelligible). Rather than riddling .run() with
try...except blocks to do this, we can

@exception_to_command_error(ModelError)
def run(...)

which makes any ModelError into a CommandError in that samba-tool command.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Often we [think we] know that all exceptions of a certain type should
be formatted as CommandErrors (i.e., the traceback is suppressed, and
the message is assumed intelligible). Rather than riddling .run() with
try...except blocks to do this, we can

@exception_to_command_error(ModelError)
def run(...)

which makes any ModelError into a CommandError in that samba-tool command.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Gary Lockyer &lt;gary@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: --version shortcircuits option evaluation</title>
<updated>2025-02-08T02:33:38+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-01-15T02:32:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=a61e192f25c61fc4f464585f6d4153c26aece352'/>
<id>a61e192f25c61fc4f464585f6d4153c26aece352</id>
<content type='text'>
This means in

   bin/samba-tool spn -h -V

the -V takes precedence over the -h, as with the 'net' tool.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This means in

   bin/samba-tool spn -h -V

the -V takes precedence over the -h, as with the 'net' tool.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: all subcommands know --version</title>
<updated>2025-02-08T02:33:38+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-01-15T02:33:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=8aec198306ed005a815220e6ca3dfed6774290b2'/>
<id>8aec198306ed005a815220e6ca3dfed6774290b2</id>
<content type='text'>
Before `samba-tool -V` would give you the version,
but `samba-tool spn -V` would complain.

An ad-hoc selection of sub-commands already supported --version,
depending on whether VersionOptions was manually added to the
takes_options dict. The .run() methods of these subcommands all take a
'versionopts' keyword argument, but never use it. If it was set (i.e.,
argv contained "--version"), the process never gets to .run(), so the
value of versionopts.version is always None in run(). After this
commit we can remove VersionOptions/versionopts from sub-commands.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before `samba-tool -V` would give you the version,
but `samba-tool spn -V` would complain.

An ad-hoc selection of sub-commands already supported --version,
depending on whether VersionOptions was manually added to the
takes_options dict. The .run() methods of these subcommands all take a
'versionopts' keyword argument, but never use it. If it was set (i.e.,
argv contained "--version"), the process never gets to .run(), so the
value of versionopts.version is always None in run(). After this
commit we can remove VersionOptions/versionopts from sub-commands.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: do not complain of no sub-command with '-V'</title>
<updated>2025-02-08T02:33:38+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2025-01-15T02:07:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=3a408f06aeaceb22ea23f6f6e8118fb8e0490591'/>
<id>3a408f06aeaceb22ea23f6f6e8118fb8e0490591</id>
<content type='text'>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15770

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Jennifer Sutton &lt;jennifersutton@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: no traceback for unauthenticated rootdse access</title>
<updated>2024-12-20T00:00:02+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2024-07-29T21:53:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=5ad1a93107a202d954663f3783c1660c9b6c8957'/>
<id>5ad1a93107a202d954663f3783c1660c9b6c8957</id>
<content type='text'>
Under some circumstances rootdse returns an operations error with
"Operation unavailable without authentication" instead of insufficient
access rights.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Douglas Bagnall &lt;dbagnall@samba.org&gt;
Autobuild-Date(master): Fri Dec 20 00:00:02 UTC 2024 on atb-devel-224
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Under some circumstances rootdse returns an operations error with
"Operation unavailable without authentication" instead of insufficient
access rights.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andreas Schneider &lt;asn@samba.org&gt;

Autobuild-User(master): Douglas Bagnall &lt;dbagnall@samba.org&gt;
Autobuild-Date(master): Fri Dec 20 00:00:02 UTC 2024 on atb-devel-224
</pre>
</div>
</content>
</entry>
<entry>
<title>samba-tool: tidy up uncaught insufficient rights LdbError</title>
<updated>2024-03-04T02:16:33+00:00</updated>
<author>
<name>Douglas Bagnall</name>
<email>douglas.bagnall@catalyst.net.nz</email>
</author>
<published>2024-03-03T21:43:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=ccfa16e2ec48da4ab601ca6b8b0ccfc77d625085'/>
<id>ccfa16e2ec48da4ab601ca6b8b0ccfc77d625085</id>
<content type='text'>
It is likely that many sub-commands will produce a traceback when people
go `-H ldap://server -Ubob` when they needed to go `-UAdministrator`.

We can catch these and show only the core message.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is likely that many sub-commands will produce a traceback when people
go `-H ldap://server -Ubob` when they needed to go `-UAdministrator`.

We can catch these and show only the core message.

Signed-off-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netcmd: properly show command name in show help</title>
<updated>2024-03-01T04:45:36+00:00</updated>
<author>
<name>Rob van der Linde</name>
<email>rob@catalyst.net.nz</email>
</author>
<published>2024-02-14T04:18:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=63d9b27908c40dbd87a8523dbba639a4be617c9a'/>
<id>63d9b27908c40dbd87a8523dbba639a4be617c9a</id>
<content type='text'>
This comes up if a user ends up typing something wrong, and it incorrectly showed only part of the command under Usage:

Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This comes up if a user ends up typing something wrong, and it incorrectly showed only part of the command under Usage:

Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>netcmd: add newline before epilog so there is a space between</title>
<updated>2024-03-01T04:45:36+00:00</updated>
<author>
<name>Rob van der Linde</name>
<email>rob@catalyst.net.nz</email>
</author>
<published>2024-02-14T04:15:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/samba.git/commit/?id=120bf34c696c1271825619bd83496d8b2cb90b48'/>
<id>120bf34c696c1271825619bd83496d8b2cb90b48</id>
<content type='text'>
Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Rob van der Linde &lt;rob@catalyst.net.nz&gt;
Reviewed-by: Andrew Bartlett &lt;abartlet@samba.org&gt;
Reviewed-by: Douglas Bagnall &lt;douglas.bagnall@catalyst.net.nz&gt;
</pre>
</div>
</content>
</entry>
</feed>
