def invoke_cmd(stdout, stderr, environ, prefix, cmd, cmd_args, error_msg, error_status):
 func_name = (prefix + cmd)
 if (func_name in globals()):
  return globals()[func_name](stdout, stderr, environ, *cmd_args)
 else:
  stderr.write(error_msg)
  return (-1)

def invoke_cmd ( stdout , stderr , environ , prefix , cmd , cmd_args , error_msg , error_status ) : func_name = ( prefix + cmd ) if ( func_name in globals ( ) ) : return globals ( ) [ func_name ] ( stdout , stderr , environ , * cmd_args ) else : stderr . write ( error_msg ) return ( - 1 )
helper function to call command and subcommands of the hadoop binary .