mirror of
https://github.com/samba-team/samba.git
synced 2025-09-13 17:44:21 +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:
committed by
Andrew Bartlett
parent
8132edf119
commit
8b403ab7c5
@@ -198,9 +198,9 @@ class Command(object):
|
|||||||
self.show_command_error(e)
|
self.show_command_error(e)
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
def run(self):
|
def run(self, *args, **kwargs):
|
||||||
"""Run the command. This should be overridden by all subclasses."""
|
"""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):
|
def get_logger(self, name="", verbose=False, quiet=False, **kwargs):
|
||||||
"""Get a logger object."""
|
"""Get a logger object."""
|
||||||
|
Reference in New Issue
Block a user