o nnh@stddlmZddlZddlmZmZmZmZddlm Z ddl m Z m Z ddl mZddlmZGdd d eZdS) ) annotationsN) AnsibleError AnsibleAction_AnsibleActionDoneAnsibleActionFail) to_native)MappingMutableMapping)boolean) ActionBasecs"eZdZdZdfdd ZZS) ActionModuleTNc sd|_d|_|dur t}tt|||}~|jjdd}|jjd}|jjdd}t |jjdddd }zz|rLt |j d ||jj d d i}|rz| d |}Wntyj} ztt| d} ~ ww|jj|jjjtj|} | |d<||| ||jjj| fnr|dkrt|tstd|jj|D]W\} } t| tsq| d} | d}|r| rqz| d |}Wnty} ztt| d} ~ ww|jj|jjjtj|} | | d<||| ||jjj| fq||d<|jj|B}| |j d |||jj dWnt!y/} z | | j"WYd} ~ nd} ~ wwW|jj s>|#|jjj|S|jj sN|#|jjjww)NTF body_formatrawbodysrc remote_srcno)strictzansible.legacy.uri) module_name task_vars wrap_async)resultfileszform-multipartz'body must be mapping, cannot be type %scontentfilename) module_argsrr)$_supports_async_supports_check_modedictsuperr run_taskargsgetr r_execute_module async_val _find_needlerrr _connection_shell join_pathtmpdirospathbasename_transfer_file _fixup_perms2 isinstancer __class____name__itemsr updaterr_remove_tmp_path)selftmprrr rrrkwargsetmp_srcfieldvaluerrnew_module_argsr1E/usr/local/lib/python3.10/dist-packages/ansible/plugins/action/uri.pyr s                zActionModule.run)NN)r2 __module__ __qualname__TRANSFERS_FILESr __classcell__r?r?r>r@r sr ) __future__rr+ansible.errorsrrrr+ansible.module_utils.common.text.convertersr'ansible.module_utils.common.collectionsrr )ansible.module_utils.parsing.convert_boolr ansible.plugins.actionr r r?r?r?r@s