%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/modules/ |
| Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/salt/modules/hadoop.pyc |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d d d d g Z d � Z d
� Z d � Z
d d � Z d d
� Z
d � Z d � Z d d � Z d S( uw
Support for hadoop
:maintainer: Yann Jouanin <yann.jouanin@intelunix.fr>
:maturity: new
:depends:
:platform: linux
i ( t absolute_importt print_functiont unicode_literalsNu versionu namenodeu dfsadminu dfsu fsc C@ s8 t j j j d � s* t j j j d � r. d St d f S( u:
Check if hadoop is present, then load the module
u hadoopu hdfsuP The hadoop execution module cannot be loaded: hadoop or hdfs binary not in path.( t saltt utilst patht whicht False( ( ( s7 /usr/lib/python2.7/site-packages/salt/modules/hadoop.pyt __virtual__ s *c G@ s� d } t j j j d � r$ d } n d
} | r� | r� | t k r� i | d 6| d 6| d 6d j | � d 6} d j | � } t d | d
t �} q� d Sn d S| S( uj
Hadoop/hdfs command wrapper
As Hadoop command has been deprecated this module will default
to use hdfs command and fall back to hadoop if it is not found
In order to prevent random execution the module name is checked
Follows hadoop command template:
hadoop module -command args
E.g.: hadoop dfs -ls /
u hadoopu hdfsu toolu moduleu commandu u argsu! {tool} {module} -{command} {args}u cmd.runt python_shellu Error: Unknown moduleu% Error: Module and command not definedN(
R R R R t Nonet __authorized_modules__t joint formatt __salt__R ( t modulet commandt argst toolt outt mappingst cmd( ( s7 /usr/lib/python2.7/site-packages/salt/modules/hadoop.pyt _hadoop_cmd s
+c C@ s# d } t | t � j � } | d S( uy
Return version from hadoop version
CLI Example:
.. code-block:: bash
salt '*' hadoop.version
u versioni ( R t Truet split( R R ( ( s7 /usr/lib/python2.7/site-packages/salt/modules/hadoop.pyt version<