diff options
author | Erik Bernoth <ebernoth@redhat.com> | 2020-11-05 19:02:22 +0100 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2020-11-10 12:15:26 -0500 |
commit | 6f9269f6c4f16a13176a013e28565bbb032749e5 (patch) | |
tree | a1101d199650dcb2a99baf29837f2c169141669e | |
parent | 61096436ad9e5ff4c36b6a3a0626038e95e5269f (diff) | |
download | sos-6f9269f6c4f16a13176a013e28565bbb032749e5.tar.gz |
[component] execute() as Abstract class
Resolves: #2295
`execute()` is a method that should be implemented by subclasses of
Component. And the python documentation recommends to also add the
method to the parent class and raise a specific error to indicate
that the parent class should not implement it.
See: https://docs.python.org/3/library/exceptions.html#NotImplementedError
Signed-off-by: Erik Bernoth <ebernoth@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/component.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sos/component.py b/sos/component.py index b44fdf82..00f27f5e 100644 --- a/sos/component.py +++ b/sos/component.py @@ -123,6 +123,9 @@ class SoSComponent(): self.manifest.add_field('policy', self.policy.distro) self.manifest.add_section('components') + def execute(self): + raise NotImplementedError + def get_exit_handler(self): def exit_handler(signum, frame): self.exit_process = True |