Skip to content

Commit

Permalink
Default plugin_name to the class name of plugin if one isn't provided…
Browse files Browse the repository at this point in the history
… in config
  • Loading branch information
mlaferrera committed Jan 16, 2020
1 parent 888950b commit 51f5868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -33,6 +33,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add `StoqConfigParser` to `stoq.helpers` to extend options for `Stoq` and plugin configurations.
- Parallelization is performed across all of the plugins that can run in a given round,
instead of parallelizing across all of the plugins to perform on a given payload (#147)
- Ensure `plugin_name` is set to the name of the plugin class in case `Name` is not defined in
the plugin's configuration.

### Changed

Expand Down
4 changes: 2 additions & 2 deletions stoq/plugins/base.py
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env python5

This comment has been minimized.

Copy link
@jeremiah-fan

jeremiah-fan Jan 16, 2020

Contributor

Why did this change to python5?

This comment has been minimized.

Copy link
@mlaferrera

mlaferrera Jan 16, 2020

Author Contributor

I meant to import future :) Apparently my vim foo went too far. It's fixed. Thanks!


# Copyright 2014-2018 PUNCH Cyber Analytics Group
#
Expand All @@ -24,7 +24,7 @@
class BasePlugin(ABC):
def __init__(self, config: StoqConfigParser) -> None:
self.config = config
self.plugin_name = config.get('Core', 'Name')
self.plugin_name = config.get('Core', 'Name', fallback=self.__class__.__name__)
self.__author__ = config.get('Documentation', 'Author', fallback='')
self.__version__ = config.get('Documentation', 'Version', fallback='')
self.__website__ = config.get('Documentation', 'Website', fallback='')
Expand Down

0 comments on commit 51f5868

Please sign in to comment.