You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Would like to be able to use callback function for run_command to call when a command has finished executing.
Describe the solution you'd like
def my_cb(host_out, my_arg):
for line in host_out.stdout:
print(line)
client.run_command('echo me', callback=my_cb, callback_extra_args=('my_arg',))
my_cb gets executed as my_cb(host_out, 'my_arg') when command completes on each host. This allows for output handling code to be executed automatically on command completion without client code having to store or handle output objects explicitly.
Describe alternatives you've considered
Can be done by sub-classing, though non-trivial.
Additional context
N/A.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Would like to be able to use callback function for
run_command
to call when a command has finished executing.Describe the solution you'd like
my_cb
gets executed asmy_cb(host_out, 'my_arg')
when command completes on each host. This allows for output handling code to be executed automatically on command completion without client code having to store or handle output objects explicitly.Describe alternatives you've considered
Can be done by sub-classing, though non-trivial.
Additional context
N/A.
The text was updated successfully, but these errors were encountered: