plugins: Move plugins to dedicated submodule

This change groups the plugin modules together under kas.plugins and
moves the @kasplugin decorator to this submodule. This will ensure the
codebase stays organised as more plugins are added.

Signed-off-by: Paul Barker <pbarker@konsulko.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Paul Barker
2020-10-16 19:31:45 +02:00
committed by Jan Kiszka
parent af4389e606
commit 1dffb986b1
5 changed files with 55 additions and 30 deletions

View File

@@ -327,14 +327,3 @@ def ssh_no_host_key_check():
os.mkdir(home + '/.ssh')
with open(home + '/.ssh/config', 'w') as fds:
fds.write('Host *\n\tStrictHostKeyChecking no\n\n')
def kasplugin(plugin_class):
"""
A decorator that registers kas plugins
"""
if not hasattr(kasplugin, 'plugins'):
setattr(kasplugin, 'plugins', {})
getattr(kasplugin, 'plugins').update({
plugin_class.name: plugin_class
})