
    Vh#                        d dl mZ d dlZd dlZd dlZd dlmZmZmZm	Z	m
Z
 d dlmZ d dlmZmZmZ d dlmZ  G d de      Zy)	    )annotationsN)AnsibleErrorAnsibleAction_AnsibleActionDoneAnsibleActionFailAnsibleActionSkip)module_manifest)to_bytes	to_nativeto_text)
ActionBasec                  H     e Zd ZdZ ej
                  d      Zd fd	Z xZS )ActionModuleTz^(?:[a-zA-Z]\:)?(\\|\/)c                *   |
t               }| j                  i ddiddiddiddiddidddgg      \  }}t        t        |   ||      }~	 |d   }|r| j                  |      rt        d	|z        |d
   }|r| j                  |      st        d|z        |d   }|rt        | j                  j                  dd      r)| j                  j                  |      st        d|z        t        | j                  j                  dd      s|j                  d      st        d|z        t        |j                  dd      d      }	t!        j"                  |	j%                               D 
cg c]  }
t'        |
d       }}
|d   }|d   }|rt        |d   d      }	 | j(                  j+                  | j-                  d|      | j.                  j0                  j                  dd            }| j.                  j4                  r-|d   s|d
   rd|d<   t7        |      d|d<   t        d|      d|d<   | j                  j                  j9                  | j                  j                  j:                  t<        j>                  jA                  |            }t'        |	      j%                         jC                  |d   |      }| jE                  ||       | jG                  | j                  j                  j:                  |fd       t               }| jI                  |      }|rdjK                  |||g      }ndjK                  ||g      }| j                  j                  jM                  |      }d}t        | j                  j                  dd      rd}d}d}d}d}| j                  jN                  r{| j                  jN                  }d}|jP                  }|jS                  d | jT                  !      }|jS                  d"| jT                  !      }|jS                  d#| jT                  !      }tW        jX                  t[        |      |i || j.                  j\                  |||||d$|d      }| j                  j                  j_                  dd%d&      }|ja                  | jc                  ||d|'             d(|v r|d(   dk7  rt        d)      | ji                  | j                  j                  j:                         |S c c}
w # t2        $ r}t        t        |            d}~ww xY w# td        $ r%}|ja                  |jf                         Y d}~d}~ww xY w# | ji                  | j                  j                  j:                         w xY w)*z& handler for file transfer operations Ntypestr)_raw_paramscmdcreatesremoveschdir
executabler   r   )argument_specrequired_one_ofr   z"%s exists, matching creates optionr   z*%s does not exist, matching removes optionr   _IS_WINDOWSFz;chdir %s must be an absolute path for a Windows remote node/z>chdir %s must be an absolute path for a Unix-aware remote node surrogate_or_strict)errorsr   r   filesdecryptT)r!   changed)resultz*Check mode is not supported for this task.)execute become_user)playcontextbecome_passbecome_flagsscriptz#!powershell)
env_stringshebangr   )r   in_datasudoabler   rcznon-zero return code)5dictvalidate_argument_specsuperr   run_remote_file_existsr   getattr_connection_shellwindows_absolute_path_detectionmatchr   
startswithr   getshlexsplitstripr   _loaderget_real_file_find_needle_taskargsr   
check_moder   	join_pathtmpdirospathbasenamereplace_transfer_file_fixup_perms2_compute_environment_stringjoinwrap_for_execbecomename
get_option_play_contextps_manifest_create_powershell_wrapperr
   	async_valbuild_module_commandupdate_low_level_execute_commandr   r#   _remove_tmp_path)selftmp	task_varsvalidation_resultnew_module_argsr#   r   r   r   
raw_paramsspartssourcer   etmp_srctarget_commandenv_dictr+   
script_cmd	exec_datarP   become_methodr&   r(   r)   become_plugin	__class__s                              M/home/dcms/DCMS/lib/python3.12/site-packages/ansible/plugins/action/script.pyr3   zActionModule.run%   s   I-1-H-H!"E?"E? %%uo & .I .
*? |T.sI>}	B%i0G ++G4+,PSZ,Z[[%i0G //8+,X[b,bcc $G,E4++22M5I @@FFuM+,ilq,qrrt//66uMV[VfVfgjVk+,lot,tuu
 #?#6#6}b#IRghJGL{{S]ScScSeGfg!WQ'<=gEg1XF )6J&|'DMbc
633D4E4Egv4V`d`j`j`o`o`s`st}  @D  aE3  F zz$$ #9-1K(,F9%,F;; ).F9%+,Xaghh !%F9 &&--778H8H8O8O8V8V8:8H8H8PRG %Z0668@@q7SN0  0 0 7 7 > >HRVW vH99(CJ XXz:~&NO
 XXz>&BC
))00>>zJJI t''..uE $""###**$($4$4$;$;M!F$1$6$6M"/":":=VZVhVh":"iK"/":":=VZVhVh":"iK#0#;#;NX\XjXj#;#kL'BBZ(&"h

@T@TM;xD	 "--44IIUWaouwIx
MM$99jR[fjrw9xyv~&,!"3'(>??
 !!$"2"2"9"9"@"@A} h   6'	!556`  	$MM!((##	$ !!$"2"2"9"9"@"@Asc   DT0 -TT0  AT 1K$T0 T0 	T-T((T--T0 0	U9UU! UU! !1V)NN)	__name__
__module____qualname__TRANSFERS_FILESrecompiler8   r3   __classcell__)rl   s   @rm   r   r      s(    O '1bjj1K&L#U U    r   )
__future__r   rG   rr   r<   ansible.errorsr   r   r   r   r   ansible.executor.powershellr	   rT   +ansible.module_utils.common.text.convertersr
   r   r   ansible.plugins.actionr   r    ru   rm   <module>r|      s3   " # 	 	  p p F T T -]: ]ru   