summaryrefslogtreecommitdiffstats
path: root/modules/func_module.py
diff options
context:
space:
mode:
authorDevan Goodwin <dgoodwin@dangerouslyinc.com>2007-10-02 21:42:47 -0300
committerJames Bowes <jbowes@redhat.com>2007-10-02 21:33:49 -0400
commit1ce955ec36f775d8fde2cb9d7943178e8b9d60da (patch)
tree4c69d218fde87091d4e5d1f3138a435b9164dbf4 /modules/func_module.py
parent3c13a4f30f247f4aa75c02c65e6bb6e575e30d01 (diff)
downloadthird_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.tar.gz
third_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.tar.xz
third_party-func-1ce955ec36f775d8fde2cb9d7943178e8b9d60da.zip
Moved code under the func namespace.
Previously we had overlord, minion, modules, and func all at the root of the source tree. After install these would all be shuffled below func. Relocated them in the source tree to reflect this.
Diffstat (limited to 'modules/func_module.py')
-rwxr-xr-xmodules/func_module.py67
1 files changed, 0 insertions, 67 deletions
diff --git a/modules/func_module.py b/modules/func_module.py
deleted file mode 100755
index 32a235d..0000000
--- a/modules/func_module.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/python
-
-##
-## Copyright 2007, Red Hat, Inc
-## see AUTHORS
-##
-## This software may be freely redistributed under the terms of the GNU
-## general public license.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program; if not, write to the Free Software
-## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-##
-
-
-from func import logger
-from func.config import read_config
-from func.commonconfig import FuncdConfig
-
-
-class FuncModule(object):
-
- # the version is meant to
- version = "0.0.0"
- api_version = "0.0.0"
- description = "No Description provided"
-
- def __init__(self):
-
- config_file = '/etc/func/minion.conf'
- self.config = read_config(config_file, FuncdConfig)
- self.__init_log()
- self.__base_methods = {
- # __'s so we don't clobber useful names
- "module_version" : self.__module_version,
- "module_api_version" : self.__module_api_version,
- "module_description" : self.__module_description,
- "list_methods" : self.__list_methods
- }
-
- def __init_log(self):
- log = logger.Logger()
- self.logger = log.logger
-
- def register_rpc(self, handlers, module_name):
- # add the internal methods, note that this means they
- # can get clobbbered by subclass versions
- for meth in self.__base_methods:
- handlers["%s.%s" % (module_name, meth)] = self.__base_methods[meth]
- for meth in self.methods:
- handlers["%s.%s" % (module_name,meth)] = self.methods[meth]
-
- def __list_methods(self):
- return self.methods.keys() + self.__base_methods.keys()
-
- def __module_version(self):
- return self.version
-
- def __module_api_version(self):
- return self.api_version
-
- def __module_description(self):
- return self.description
-
-
-methods = FuncModule()
-register_rpc = methods.register_rpc