Re: [PATCH] Simplify our modules by auto-detecting them and registering their handlers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Luke Macken wrote:
Dear Lords of Func,

This is a pretty significant change to the way our modules are currently
written.  The result is that it makes writing modules much more simple, by
removing all hard-coded method definitions and register_rpc methods.

Some brief testing on my end shows it to work fine, but still needs more
testing to ensure that we don't regress.

If no one has any problems with it, I can commit it.

Oops, looks like this over-exposes our modules a bit. Here is a patch to hide the register_rpc method.

luke

--- a/func/minion/modules/func_module.py
+++ b/func/minion/modules/func_module.py
@@ -49,7 +49,8 @@ class FuncModule(object):
.
        # register all methods that don't start with an underscore
        for attr in dir(self):
-            if inspect.ismethod(getattr(self, attr)) and attr[0] != '_':
+ if inspect.ismethod(getattr(self, attr)) and attr[0] != '_' and \
+                    attr != 'register_rpc':
handlers["%s.%s" % (module_name, attr)] = getattr(self, attr)
.
    def __list_methods(self):

_______________________________________________
Func-list mailing list
Func-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/func-list

[Index of Archives]     [Fedora Users]     [Linux Networking]     [Fedora Legacy List]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux