1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

samba-tool: do not crash on unimplemented .run()

The run() method is always called with arguments, so it crashes before
the NotImplementedError() is ever reached. That's OK, but this is better.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2022-08-16 13:43:54 +12:00 committed by Andrew Bartlett
parent 8132edf119
commit 8b403ab7c5

View File

@ -198,9 +198,9 @@ class Command(object):
self.show_command_error(e)
return -1
def run(self):
def run(self, *args, **kwargs):
"""Run the command. This should be overridden by all subclasses."""
raise NotImplementedError(self.run)
raise NotImplementedError(f"'{self.command_name}' run method not implemented")
def get_logger(self, name="", verbose=False, quiet=False, **kwargs):
"""Get a logger object."""