a )g@sddlmZmZmZeZddlmZddlZddl Z ddl m Z ddlmZddlmZddlmZddlmZeZe jrd d lmZiZiZiZd d ZGd ddeZGdddeZdS))absolute_importdivisionprint_function)ABCN) constants) AnsibleError) to_native) string_types)Display)PluginPathContextcCs2t|tr|ddS|jjddSdSNmodule) isinstancer lowerreplace __class____name__)objrs  zAnsiblePlugin.matches_nameNc Csp||jvrdztjj||j|j|d}Wn0tyV}ztt|WYd}~n d}~00| |||j |S)N) plugin_typeZ plugin_name variables) rCconfigZget_config_valuer) _load_namerKeyErrorr set_optionget)roptionhostvarsZ option_valueerrr get_optionHs " zAnsiblePlugin.get_optioncCs*i}|jD]}|j||d||<q|S)N)r2)option_definitionskeysr4)rr2optionsr1rrr get_optionsQszAnsiblePlugin.get_optionscCs||j|<dSr)r)rr1valuerrrr/WszAnsiblePlugin.set_optioncCsBtjj|j|j|||d|_|jr>|r>d|vr>|d|ddS)a* Sets the _options attribute with the configuration/keyword information for this plugin :arg task_keys: Dict with playbook keywords that affect this option :arg var_options: Dict with either 'connection variables' :arg direct: Dict with 'direct assignment' )r6r*directZ_extrasN)r+r,Zget_plugin_optionsr)r-r allow_extrasr/)rZ task_keysZ var_optionsr:rrr set_optionsZszAnsiblePlugin.set_optionscCs|js|||jvSr)rr<)rr1rrr has_optioniszAnsiblePlugin.has_optioncCs|jjddSr rrrrrrrrr)nszAnsiblePlugin.plugin_typecCs&|jdur tjj|j|jd|_|jS)N)r)r')rr+r,Zget_configuration_definitionsr)r-rrrrr5rs z AnsiblePlugin.option_definitionscCsdSrrrrrr_check_requiredxszAnsiblePlugin._check_required)N)N)NNN)r __module__ __qualname__r;rr(r4r8r/r<r=propertyr)r5r?rrrrr5s    rcsTeZdZfddZeddZddZeZZZ Z Z Z eddZ ZS) AnsibleJinja2Plugincstt|||_dSr)superrCr _function)rfunctionrrrrszAnsibleJinja2Plugin.__init__cCs|jjddS)NZ ansiblejinja2rr>rrrrr)szAnsibleJinja2Plugin.plugin_typecOs tdSr)NotImplementedError)rargskwargsrrr _no_optionsszAnsibleJinja2Plugin._no_optionscCs|jSr)rErrrr j2_functionszAnsibleJinja2Plugin.j2_function)rr@rArrBr)rKr=r4r8r5r/r<rL __classcell__rrrGrrC}s  rC) Z __future__rrrtypeZ __metaclass__abcrtypestypingtZansiblerr+Zansible.errorsrZansible.module_utils._textrZansible.module_utils.sixr Zansible.utils.displayr Zdisplay TYPE_CHECKINGloaderr Z MODULE_CACHEZ PATH_CACHEZPLUGIN_PATH_CACHErrrCrrrrs$       H