diff options
author | Michael DeHaan <mdehaan@redhat.com> | 2008-02-07 13:13:24 -0500 |
---|---|---|
committer | Michael DeHaan <mdehaan@redhat.com> | 2008-02-07 13:13:24 -0500 |
commit | 8f2ff4d7c902d534d68ff1a16418b7be492033bf (patch) | |
tree | 73cd958ea6f8e0728592fec759848280b8891f12 /func/minion/modules/func_module.py | |
parent | 5b2601a56907b02efc6567354fa051ef08d97b6f (diff) | |
download | certmaster-8f2ff4d7c902d534d68ff1a16418b7be492033bf.tar.gz certmaster-8f2ff4d7c902d534d68ff1a16418b7be492033bf.tar.xz certmaster-8f2ff4d7c902d534d68ff1a16418b7be492033bf.zip |
Carving away at func some more to just get down to cert items, still lots
more to do.
Diffstat (limited to 'func/minion/modules/func_module.py')
-rw-r--r-- | func/minion/modules/func_module.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/func/minion/modules/func_module.py b/func/minion/modules/func_module.py deleted file mode 100644 index 7d476dc..0000000 --- a/func/minion/modules/func_module.py +++ /dev/null @@ -1,76 +0,0 @@ -## -## 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. -## - -import inspect - -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] - - # register our module's handlers - for name, handler in self.__list_handlers().items(): - handlers["%s.%s" % (module_name, name)] = handler - - def __list_handlers(self): - """ Return a dict of { handler_name, method, ... }. - All methods that do not being with an underscore will be exposed. - We also make sure to not expose our register_rpc method. - """ - handlers = {} - for attr in dir(self): - if inspect.ismethod(getattr(self, attr)) and attr[0] != '_' and \ - attr != 'register_rpc': - handlers[attr] = getattr(self, attr) - return handlers - - def __list_methods(self): - return self.__list_handlers().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 |