<s> '''<STR_LIT>''' <EOL> from __future__ import absolute_import <EOL> import salt . utils <EOL> __authorized_modules__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __virtual__ ( ) : <EOL> '''<STR_LIT>''' <EOL> if salt . utils . which ( '<STR_LIT>' ) : <EOL> return '<STR_LIT>' <EOL> return ( False , '<STR_LIT>' ) <EOL> def version ( ) : <EOL> '''<STR_LIT>''' <EOL> cmd = '<STR_LIT>' <EOL> out = __salt__ [ '<STR_LIT>' ] ( cmd ) . split ( ) <EOL> return out [ <NUM_LIT:1> ] <EOL> def _hadoop_cmd ( module , command , * args ) : <EOL> '''<STR_LIT>''' <EOL> out = None <EOL> if module and command : <EOL> if module in __authorized_modules__ : <EOL> cmd = '<STR_LIT>' . format ( module , command , '<STR_LIT:U+0020>' . join ( args ) ) <EOL> out = __salt__ [ '<STR_LIT>' ] ( cmd , python_shell = False ) <EOL> else : <EOL> return '<STR_LIT>' <EOL> else : <EOL> return '<STR_LIT>' <EOL> return out <EOL> def dfs ( command = None , * args ) : <EOL> '''<STR_LIT>''' <EOL> if command : <EOL> return _hadoop_cmd ( '<STR_LIT>' , command , * args ) <EOL> else : <EOL> return '<STR_LIT>' <EOL> def dfs_present ( path ) : <EOL> '''<STR_LIT>''' <EOL> cmd_return = _hadoop_cmd ( '<STR_LIT>' , '<STR_LIT>' , path ) <EOL> if '<STR_LIT>' in cmd_return : <EOL> return False <EOL> else : <EOL> return True <EOL> def dfs_absent ( path ) : <EOL> '''<STR_LIT>''' <EOL> cmd_return = _hadoop_cmd ( '<STR_LIT>' , '<STR_LIT>' , path ) <EOL> if '<STR_LIT>' in cmd_return : <EOL> return True <EOL> else : <EOL> return False <EOL> def namenode_format ( force = None ) : <EOL> '''<STR_LIT>''' <EOL> force_param = '<STR_LIT>' <EOL> if force : <EOL> force_param = '<STR_LIT>' <EOL> return _hadoop_cmd ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , force_param ) </s>
