Enabled config parameters to plugins
In this changeset, I added the possibility for all plugins to define configuration parameters for themselves. Partially Implements: blueprint plugins-parameters Change-Id: I676b2583b3b4841c64c862b2b0c234b4eb5fd0fd
This commit is contained in:
@@ -14,8 +14,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
from watcher.decision_engine.strategy.strategies import base as base_strategy
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
class FakeStrategy(base_strategy.BaseStrategy):
|
||||
|
||||
@@ -48,6 +52,10 @@ class FakeStrategy(base_strategy.BaseStrategy):
|
||||
def get_translatable_goal_display_name(cls):
|
||||
return cls.GOAL_DISPLAY_NAME
|
||||
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return []
|
||||
|
||||
def execute(self, original_model):
|
||||
pass
|
||||
|
||||
@@ -58,6 +66,12 @@ class FakeDummy1Strategy1(FakeStrategy):
|
||||
NAME = "STRATEGY_1"
|
||||
DISPLAY_NAME = "Strategy 1"
|
||||
|
||||
@classmethod
|
||||
def get_config_opts(cls):
|
||||
return [
|
||||
cfg.StrOpt('test_opt', help="Option used for testing."),
|
||||
]
|
||||
|
||||
|
||||
class FakeDummy1Strategy2(FakeStrategy):
|
||||
GOAL_NAME = "DUMMY_1"
|
||||
|
||||
Reference in New Issue
Block a user