Re: Async calls from command line

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

 



Krzysztof A. Adamski wrote:
I've done some initial work on async calls from command lines. This
change needs testing (as i only done limited testing since i only have
two testing minions right now) and comments.

You can see the code online:
http://github.com/kadamski/func/commits/async

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

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

You have to update RPM only on overlord as nothing related to minion is
changed. After installing this version you will have four additional
options:
--async
--nopoll
--sport
--jobstatus

You can call any module in async mode with:
 func '*' call --async iptables policy
results should be printed in the order they come back to overlord.
You can wait for all results and then print them sorted with:
 func '*' call --async --sort iptables policy

If you don't want to wait for results you can run:
 func '*' call --async --nopoll iptables policy
this will return JOB_ID which can be used to check for results:
 func '*' call --jobstatus JOB_ID

Waiting for comments and bug reports..

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

FYI, I'm getting this on my machine:

[root@mdehaan func]# func "*" call --async command run /bin/echo 1
Traceback (most recent call last):
File "/usr/bin/func", line 12, in <module>
cli.parse(argv)
File "/usr/lib/python2.5/site-packages/func/overlord/command.py", line 247, in parse
return self.subCommands[command].parse(args[1:])
File "/usr/lib/python2.5/site-packages/func/overlord/cmd_modules/call.py", line 72, in parse
return base_command.BaseCommand.parse(self, argv)
File "/usr/lib/python2.5/site-packages/func/overlord/command.py", line 228, in parse
ret = self.do(args)
File "/usr/lib/python2.5/site-packages/func/overlord/cmd_modules/call.py", line 131, in do
results = self.overlord_obj.run(self.module, self.method, self.method_args)
File "/usr/lib/python2.5/site-packages/func/overlord/client.py", line 311, in run
results = jobthing.batch_run(self.minions, process_server, nforks)
File "/usr/lib/python2.5/site-packages/func/jobthing.py", line 121, in batch_run
results = forkbomb.batch_run(server, process_server, nforks)
File "/usr/lib/python2.5/site-packages/func/forkbomb.py", line 139, in batch_run
__forkbomb(0,buckets,callback,shelf_file)
File "/usr/lib/python2.5/site-packages/func/forkbomb.py", line 113, in __forkbomb
__with_my_bucket(mybucket,buckets,what_to_do,filename)
File "/usr/lib/python2.5/site-packages/func/forkbomb.py", line 90, in __with_my_bucket
things_in_my_bucket = buckets[bucket_number]
KeyError: 0

I saw you made a change earlier in the git history WRT forkbomb.py, maybe that was it.

There's also some noise in "ping"'s output, which may have been something I added earlier:

[root@mdehaan func]# func "*" ping
results 1 <type 'int'>
[ ok ... ] mdehaan.rdu.redhat.com


I only have one minion in my configuration.


_______________________________________________
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