diff options
author | Adrian Likins <alikins@redhat.com> | 2008-10-24 14:11:08 -0400 |
---|---|---|
committer | Adrian Likins <alikins@redhat.com> | 2008-10-24 14:11:08 -0400 |
commit | 89981413977258a3f4b28df5208a9474b5112e4d (patch) | |
tree | 292793f0dd49ad5cba88f954a4fc943b0777d72a /func | |
parent | e22199a3c8d1cb9e54d8179ffd0e9ad4a34f8947 (diff) | |
download | func-89981413977258a3f4b28df5208a9474b5112e4d.tar.gz func-89981413977258a3f4b28df5208a9474b5112e4d.tar.xz func-89981413977258a3f4b28df5208a9474b5112e4d.zip |
Fix minion module config examples. Add local "Config" class to module.
Add in all the approriate types and defaults to Config class
Update etc/Test.conf example to include everything in main. For now
we only support one stanza config files for modules.
updated test cases to test that proper values are fetched from the
config file for the "test" module
Diffstat (limited to 'func')
-rw-r--r-- | func/minion/modules/test.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/func/minion/modules/test.py b/func/minion/modules/test.py index 4548a84..7c298e2 100644 --- a/func/minion/modules/test.py +++ b/func/minion/modules/test.py @@ -1,12 +1,22 @@ import func_module import time import exceptions +from certmaster.config import BaseConfig, Option, IntOption, FloatOption, BoolOption class Test(func_module.FuncModule): version = "11.11.11" api_version = "0.0.1" description = "Just a very simple example module" + class Config(BaseConfig): + example = Option('1') + string_option = Option('some string here') + int_option = IntOption(37) + bool_option = BoolOption(True) + float_option = FloatOption(3.14159) + testvalue = 'this is a test. It is only a test' + + def add(self, numb1, numb2): return numb1 + numb2 @@ -63,7 +73,7 @@ class Test(func_module.FuncModule): return getattr(self.options, key_name) def config_get_test(self): - return self.options.anothersection.testvalue + return self.options.testvalue def register_method_args(self): """ |