def multirun(spec, arg): """run the command in parallel on the various hosts""" env().multirun( arg, spec.shell, spec.pty, spec.combine_stderr, spec.dir, spec.format, quiet_exit=1 )
def multilocal(spec, arg): """run the command in parallel locally for each host""" def run_local(): return local(arg, capture=0, dir=spec.dir, format=spec.format) env().multirun( run_local, spec.shell, spec.pty, spec.combine_stderr, spec.dir, spec.format, quiet_exit=1 )
def multisudo(spec, arg): """run the sudoed command in parallel on the various hosts""" def run_sudo(): return sudo( arg, spec.shell, spec.pty, spec.combine_stderr, None, spec.dir, spec.format ) env().multirun( run_sudo, spec.shell, spec.pty, spec.combine_stderr, spec.dir, spec.format, quiet_exit=1 )
def info(spec, arg): """list the hosts and the current context""" print print "Context:" print print "\n".join(" %s" % ctx for ctx in env.ctx) print print "Hosts:" print for setting in env().settings: print " ", setting['host_string'] print