a ì)g¤ã@snddlmZmZmZeZddlmZddlm Z ddl m Z ddl mZddlmZeƒZGdd„deƒZd S) é)Úabsolute_importÚdivisionÚprint_function)ÚMutableMapping)Ú constants)Ú AnsibleError)Ú cache_loader)ÚDisplaycspeZdZ‡fdd„Zdd„Zdd„Zdd„Zd d „Zd d „Zd d„Z dd„Z dd„Z dd„Z ‡fdd„Z ‡ZS)Ú FactCachecs<t tj¡|_|js"tdtjƒ‚tt|ƒj|i|¤ŽdS)Nz+Unable to load the facts cache plugin (%s).) rÚgetÚCZ CACHE_PLUGINÚ_pluginrÚsuperr Ú__init__)ÚselfÚargsÚkwargs©Ú __class__©ú;/usr/lib/python3.9/site-packages/ansible/vars/fact_cache.pyrszFactCache.__init__cCs|j |¡st‚|j |¡S©N)r ÚcontainsÚKeyErrorr ©rÚkeyrrrÚ __getitem__s zFactCache.__getitem__cCs|j ||¡dSr)r Úset)rrÚvaluerrrÚ __setitem__#szFactCache.__setitem__cCs|j |¡dSr)r ÚdeleterrrrÚ __delitem__&szFactCache.__delitem__cCs |j |¡Sr)r rrrrrÚ __contains__)szFactCache.__contains__cCst|j ¡ƒSr)Úiterr Úkeys©rrrrÚ__iter__,szFactCache.__iter__cCst|j ¡ƒSr)Úlenr r$r%rrrÚ__len__/szFactCache.__len__cCst|ƒS)z@ Return a primitive copy of the keys and values from the cache. )Údictr%rrrÚcopy2szFactCache.copycCs |j ¡Sr)r r$r%rrrr$6szFactCache.keyscCs|j ¡dS)z# Flush the fact cache of all keys. N)r Úflushr%rrrr+9szFactCache.flushcsV||i}z&|j |¡}|r,| |¡|||<Wnty@Yn0tt|ƒ |¡dSr)r r Úupdaterrr )rrrZ host_factsZ host_cacherrrÚfirst_order_merge=s    zFactCache.first_order_merge)Ú__name__Ú __module__Ú __qualname__rrrr!r"r&r(r*r$r+r-Ú __classcell__rrrrr s r N)Z __future__rrrÚtypeZ __metaclass__Úcollections.abcrZansiblerr Zansible.errorsrZansible.plugins.loaderrZansible.utils.displayr Zdisplayr rrrrÚs