[PATCH] get_method_args() Update

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

 



Hi ML, after we talked about my previous patch with mpdehaan we decided to 
change it and make it more beatiful:) . I added a get_method_args() to code 
base 
that method doesnt break the current code base. It is useful when other 
applications like funcweb want to have the method's argument, therefore if a 
user wants its module to be reachable from funcweb he/she needs to override 
register_method_args in the module and fill  it according to rules we decided.
If the patch is accepted i will add them to wiki ;)

You can get my branch as same as kadamski explained, I copy and paste here 
again :)

You can see the code online:
http://github.com/makkalot/func/commits/makkalot_extreme

Or import my branch to your func git tree:
 git remote add makkalot git://github.com/makkalot/func.git
 git fetch makkalot
 git checkout -b makkalot_extreme makkalot/makkalot_extreme
[make/install/test and when you are done you can remove it:]
 git branch -D makkalot_extreme

Or just clone it from github:
 git clone git://github.com/makkalot/func.git

I have a diff if iyou dont want to do all the stuff :)
http://tutorials-place.com/media/makkalot_stuff/get_method_arg.patch

------------------------------------------------------------------------------------------------------------------------------------------------------
And here is an example how to use it :

In [1]: from func.overlord.client import Overlord

In [2]: fc = Overlord("acervirtual.evlan.com")

In [6]: fc.service.get_method_args()
Out[6]:
{'acervirtual.evlan.com': {'get_enabled': {},
                           'get_running': {},
                           'inventory': {},
                           'reload': {'service_name': {'description': 'The 
name of the running services',
                                                       'type': 'string',
                                                       'validator': '^[a-z]+$'}},
                           'restart': {'service_name': {'description': 'The 
name of the running services',
                                                        'type': 'string',
                                                        'validator': '^[a-z]+$'}},
                           'start': {'service_name': {'description': 'The name 
of the running services',
                                                      'type': 'string',
                                                      'validator': '^[a-z]+$'}},
                           'status': {'service_name': {'description': 'The 
name of the running services',
                                                       'type': 'string',
                                                       'validator': '^[a-z]+$'}},
                           'stop': {'service_name': {'description': 'The name 
of the running services',
                                                     'type': 'string',
                                                     'validator': '^[a-z]+$'}}}}

In [7]: fc.iptables.get_method_args()
Out[7]: {'acervirtual.evlan.com': {}}


 

_______________________________________________
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