def _hadoop_cmd(module, command, *args):
 out = None
 if (module and command):
  if (module in __authorized_modules__):
   cmd = 'hadoop {0} -{1} {2}'.format(module, command, ' '.join(args))
   out = __salt__['cmd.run'](cmd, python_shell=False)
  else:
   return 'Error: Unknown module'
 else:
  return 'Error: Module and command not defined'
 return out

def _hadoop_cmd ( module , command , * args ) : out = None if ( module and command ) : if ( module in __authorized_modules__ ) : cmd = 'hadoop {0} -{1} {2}' . format ( module , command , ' ' . join ( args ) ) out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) else : return 'Error: Unknown module' else : return 'Error: Module and command not defined' return out
hadoop command wrapper in order to prevent random execution the module name is checked follows hadoop command template: hadoop module -command args e .