def _ssh_run(ssh_bin, address, ec2_key_pair_file, cmd_args, stdin=''):
 args = (_ssh_args(ssh_bin, address, ec2_key_pair_file) + list(cmd_args))
 log.debug(('> %s' % cmd_line(args)))
 p = Popen(args, stdout=PIPE, stderr=PIPE, stdin=PIPE)
 return p.communicate(stdin)

def _ssh_run ( ssh_bin , address , ec2_key_pair_file , cmd_args , stdin = '' ) : args = ( _ssh_args ( ssh_bin , address , ec2_key_pair_file ) + list ( cmd_args ) ) log . debug ( ( '> %s' % cmd_line ( args ) ) ) p = Popen ( args , stdout = PIPE , stderr = PIPE , stdin = PIPE ) return p . communicate ( stdin )
shortcut to call ssh on a hadoop node via subprocess .