o n¾nhoã@sbddlmZddlmZddlmZddlmZddl m Z ddl m Z e ƒZ Gdd„deƒZd S) é)Ú annotations)Ú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¡|_|jstdtjƒ‚tt|ƒj|i|¤ŽdS)Nz+Unable to load the facts cache plugin (%s).) rÚgetÚCÚ CACHE_PLUGINÚ_pluginrÚsuperrÚ__init__)ÚselfÚargsÚkwargs©Ú __class__©úB/usr/local/lib/python3.10/dist-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__(s zFactCache.__contains__cCót|j ¡ƒSr)Úiterr Úkeys©rrrrÚ__iter__+ózFactCache.__iter__cCr"r)Úlenr r$r%rrrÚ__len__.r'zFactCache.__len__cCst|ƒS)z@ Return a primitive copy of the keys and values from the cache. )Údictr%rrrÚcopy1szFactCache.copycCs |j ¡Sr)r r$r%rrrr$5s zFactCache.keyscCs|j ¡dS)z# Flush the fact cache of all keys. N)r Úflushr%rrrr,8szFactCache.flushcsV||i}z|j |¡}|r| |¡|||<Wn ty Ynwtt|ƒ |¡dSr)r r Úupdaterr r)rrrÚ host_factsÚ host_cacherrrÚfirst_order_merge<s  € ÿzFactCache.first_order_merge)Ú__name__Ú __module__Ú __qualname__rrrr r!r&r)r+r$r,r0Ú __classcell__rrrrrs rN)Ú __future__rÚcollections.abcrÚansiblerr Úansible.errorsrÚansible.plugins.loaderrÚansible.utils.displayrÚdisplayrrrrrÚs