Re: Module to get arg list from func methods in the classes of the modules

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

 



Louis Coilliot wrote:
Hello,

the module is in attachment, FYI.

I wrote this primarily for Symbolic. Symbolic needs to get the arg list to create forms for WebUI operations based on func modules, and the register_method_args method is not always defined (that's a pity).

Perhaps it would be better to implement this in the inners of func, but as a func module it was quick to do.

I like it. I'm poking around now to see if there is a good spot to put this into func core so
we can expose this and potentially more of "inspect" functions.

I'm adding this to the git tree for now as a module. If we move it later, it should be easy to deal with.


Adrian


Examples of use:
import func.overlord.client as fc
c = fc.Client("*")

print c.func_getargs.get('mount','umount')
print c.func_getargs.get('command','run')
print c.func_getargs.get('reboot','reboot')

will return (here on the minion 'kermit'):

{'kermit': ['dir', 'killall', 'force', 'lazy']}
{'kermit': ['command', 'env']}
{'kermit': ['when', 'message']}



Louis
------------------------------------------------------------------------

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

_______________________________________________
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