
j4Vdc        2   @   s  d  Z  d d l Z d d l Z d d l m Z d d l m Z m Z d d l m	 Z	 d d l
 m Z m Z e j d k Z d   Z d	   Z d
 Z e j j e j j d  d d  Z e d d d d d e d d e d d d d d e d d e d d d d e d d e d d d d d e   d d d d  e d! d d d e d d" e d# d$ d d d e d d% e d& d' d d d e d d( e d) d* d d+ d d d d, e d- d. d d d d/ d d0 e d1 d d d d d d2 e d3 d d d d d d4 e d5 d d d d d d6 e d7 d d8 d d9 e d: d; d g  d d< e d= d d> d d? d d d d d d@ e dA dB d d d e d dC e dD d dE dF e d dG d dH d dI e dJ d d d e d dK e dL dM dF dN d dO d dP d dQ d dR e dS d dT d dU d e d dV e dW dX d d d dY e dZ d[ d d\ d d d e d d] e d^ d e d d_ e d` da d d d e d db e dc d d d dd e de d d d df e dg dh d g  d di e dj dk d dl d dm e dn d d8 d do e dp d d d e d dq e dr d d d e d ds e dt d e d d d du e dv dw dF dN d dx d dH d dy e dz d{ d d| dF dN d d d dH d d} e d~ d d e   d d e d d d d d e d d e d d d g  d d d d e d d d d dF dN d d d dG d d g& Z e i/ d d 6d d 6g  d 6e d 6e d 6d d 6g  d 6d d 6e d 6e d 6e d 6e d 6g  d 6g  d 6d d 6d d 6d d 6d d 6d d 6d d 6d d 6e   d 6e d 6i  d 6d d 6d> d 6e d 6d d 6d d 6g  d 6i  d 6i  d 6e d 6e d 6e d 6i  d 6dG g d 6d d 6d d 6d d 6g  d 6i  d 6i e d 6d 6e d 6e d 6d d 6e	 d  d 6 Z d g Z i  Z x e D] Z e e e <qWe e d i e d 6e _ x e D] Z  e  j! e e  j" <qWi  Z# e   Z$ d   Z% d   Z& e i	 e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6e d 6d i d d d d d g d 6d d g d 6d d g d 6Z' d S(   sI   
Internal shared-state variables such as config settings and host lists.
iN(   t   make_option(   t   HostConnectionCachet   ssh(   t   get_version(   t
   _AliasDictt   _AttributeDictt   win32c          C   s   d d l  }  d } y |  j   } WnZ t k
 r5 nJ t k
 r~ t r d d l } d d l } d d l } | j	   } q n X| S(   sT   
    Obtain name of current system user, which will be default connection user.
    iN(
   t   getpasst   Nonet   getusert   KeyErrort   ImportErrorR   t   win32apit   win32securityt   win32profilet   GetUserName(   R   t   usernameR   R   R   (    (    sZ   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/state.pyt   _get_system_username   s    c          C   st   d }  d |  } t  j j |  } | | k rp t rp d d l m } d d l m } d | d |  |  f } n  | S(   sI   
    Return platform-specific default file path for $HOME/.fabricrc.
    s	   .fabricrcs   ~/i(   t   SHGetSpecialFolderPath(   t   CSIDL_PROFILEs   %s/%si    (   t   ost   patht
   expanduserR   t   win32com.shell.shellR   t   win32com.shell.shellconR   (   t   rc_filet   rc_patht   expanded_rc_pathR   R   (    (    sZ   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/state.pyt   _rc_path6   s    
t   22t   ~s   .ssht   configs   -as
   --no_agentt   actiont
   store_truet   defaultt   helps   don't use the running SSH agents   -As   --forward-agents!   forward local agent to remote ends   --abort-on-promptss4   abort instead of prompting (for password, host, etc)s   -cs   --configt   destt   rcfilet   metavart   PATHs&   specify location of config file to uses   --colorize-errorss   Color error outputs   -Ds   --disable-known-hostss!   do not load user known_hosts files   -es   --eagerly-disconnects)   disconnect from hosts as soon as possibles   -fs	   --fabfilet   fabfiles0   python module file to import, e.g. '../other.py's   -gs	   --gatewayt   HOSTs   gateway host to connect throughs
   --gss-auths   Use GSS-API authentications   --gss-delegs*   Delegate GSS-API client credentials or nots	   --gss-kexs4   Perform GSS-API Key Exchange and user authentications   --hidet   LEVELSs-   comma-separated list of output levels to hides   -Hs   --hostss+   comma-separated list of hosts to operate ons   -it   appendt   key_filenames.   path to SSH private key file. May be repeated.s   -ks	   --no-keyss)   don't load private key files from ~/.ssh/s   --keepalivet	   keepalivet   typei    t   Ns#   enables a keepalive every N secondss
   --linewises*   print line-by-line instead of byte-by-bytes   -ns   --connection-attemptst   intt   Mt   connection_attemptsi   s+   make M attempts to connect before giving ups   --no-ptyt   always_use_ptyt   store_falses&   do not use pseudo-terminal in run/sudos   -ps
   --passwords0   password for use with authentication and/or sudos   -Ps
   --parallelt   parallels$   default to parallel execution methods   --ports   SSH connection ports   -rs   --reject-unknown-hostss   reject unknown hostss   --sudo-passwords   password for use with sudo onlys   --system-known-hostss<   load system known_hosts file before reading user known_hostss   -Rs   --roless+   comma-separated list of roles to operate ons   -ss   --shells   /bin/bash -l -cs2   specify a new shell, defaults to '/bin/bash -l -c's   --shows-   comma-separated list of output levels to shows   --skip-bad-hostss%   skip over hosts that can't be reacheds   --skip-unknown-taskss   skip over unknown taskss   --ssh-config-paths   Path to SSH config files   -ts	   --timeouti
   s#   set connection timeout to N secondss   -Ts   --command-timeoutt   command_timeouts'   set remote command timeout to N secondss   -us   --users/   username to use when connecting to remote hostss   -ws   --warn-onlys*   warn, instead of abort, when commands fails   -xs   --exclude-hostst   HOSTSs(   comma-separated list of hosts to excludes   -zs   --pool-sizet	   pool_sizet   INTs6   number of concurrent processes to use in parallel modet   abort_exceptions   Sorry, try again.t   again_promptt	   all_hostst   combine_stderrt   colorize_errorst   commandt   command_prefixest    t   cwdt   dedupe_hostst   default_portt   eagerly_disconnectt
   echo_stdint   effective_rolest   exclude_hostst   gatewayt   gss_autht	   gss_delegt   gss_kext   hostt   host_stringt   lcwdt
   local_usert   output_prefixt	   passwordsR   t   path_behaviort   portt   real_fabfilet   remote_interruptt   rolest   roledefst	   shell_envt   skip_bad_hostst   skip_unknown_taskst   ssh_config_patht   sudo_passwordst   ok_ret_codess   sudo -S -p '%(sudo_prompt)s' t   sudo_prefixs   sudo password:t   sudo_promptt	   sudo_usert   taskst   promptst   networkt   use_exceptions_fort	   use_shellt   use_ssh_configt   usert   shortt   versiont   aliasest
   everythingc           C   s   t  t j j   j   S(   N(   t   connectionst   envRN   t   get_transportt   open_session(    (    (    sZ   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/state.pyt   _open_session  s    c          C   s|   y t    }  WnR t j k
 ra } t |  d k r[ t t j j   t t j =t    }  qb   n X|  j d  t	 |  _
 |  S(   s?   
    Return a channel object based on ``env.host_string``.
    s   SSH session not activeg?(   Rq   R   t   SSHExceptiont   strRm   Rn   RN   t   closet
   settimeoutt   Truet   input_enabled(   t   chant   err(    (    sZ   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/state.pyt   default_channel  s    
	t   statust   abortst   warningst   runningt   stdoutt   stderrt
   exceptionst   debugt   outputt   commands((   t   __doc__R   t   syst   optparseR    t   fabric.networkR   R   t   fabric.versionR   t   fabric.utilsR   R   t   platformR   R   R   RD   R   t   joinR   t   default_ssh_config_patht   FalseR   R0   Rv   t   env_optionsRn   R   t   exception_dictt   eRe   t   optionR"   R$   R   Rm   Rq   Rz   R   (    (    (    sZ   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/fabric/state.pyt   <module>   s  			$																			

					
