summaryrefslogtreecommitdiffstats
path: root/func/minion/modules/hardware.py
diff options
context:
space:
mode:
authorLuke Macken <lmacken@redhat.com>2008-01-15 17:42:05 -0500
committerLuke Macken <lmacken@redhat.com>2008-01-15 17:42:05 -0500
commit23c9c26d270ff766133e7aeebffc99a35633ef41 (patch)
treed68c5030efd41b5de10dcf7d92b1fa2c0c86b445 /func/minion/modules/hardware.py
parentc4371ce647118902dd7574394d86c690c9be686e (diff)
downloadthird_party-func-23c9c26d270ff766133e7aeebffc99a35633ef41.tar.gz
third_party-func-23c9c26d270ff766133e7aeebffc99a35633ef41.tar.xz
third_party-func-23c9c26d270ff766133e7aeebffc99a35633ef41.zip
Simplify our modules by auto-detecting them and registering their handlers
- Auto-detect and load all FuncModules. This obsoletes the need to have our modules define a register_rpc method. - Use introspection in our FuncModule to auto-register all method handlers that do not being with an underscore. This obsoletes the need to hardcode methods in our modules. - Remove all __init__ methods from our modules, along with register_rpc - Modify the func-create-module script to reflect these changes. Note that doing 'from modules import func_module' is no longer supported in our modules, do to some interesting path issues with our auto-detection code. Supported methods are now: 'import func_module' or 'from func.minion.modules import func_module'
Diffstat (limited to 'func/minion/modules/hardware.py')
-rw-r--r--func/minion/modules/hardware.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/func/minion/modules/hardware.py b/func/minion/modules/hardware.py
index acf5988..5136228 100644
--- a/func/minion/modules/hardware.py
+++ b/func/minion/modules/hardware.py
@@ -20,18 +20,11 @@ import sys
# our modules
import sub_process
-from modules import func_module
+import func_module
# =================================
class HardwareModule(func_module.FuncModule):
- def __init__(self):
- self.methods = {
- "info" : self.info,
- "inventory" : self.inventory, # for func-inventory
- "hal_info" : self.hal_info
- }
- func_module.FuncModule.__init__(self)
def hal_info(self):
"""
@@ -131,6 +124,3 @@ def hw_info(with_devices=True):
})
return data
-
-methods = HardwareModule()
-register_rpc = methods.register_rpc