ó oBú]c@ssddlZddlZddlZddlZddlZdZejeƒZede d„Z ed„Z dS(iÿÿÿÿNi¤twbcCs|rBy%tj|ƒ}tj|jƒ}WqBtk r>qBXnd}ytjdtjj |ƒdt d|ƒ}t j d||j ||t|ƒƒ|j|ƒ|jƒtj|j |ƒtj|j |ƒWn8tk r}|dk r tj|j ƒn|‚nXdS(NtdirtdeletetmodesOAtomically writing to file %s (via temporary file %s) - %s: [%o] %d bytes/chars(toststattS_IMODEtst_modetOSErrortNonettempfiletNamedTemporaryFiletpathtdirnametFalsetLOGtdebugtnametlentwritetclosetchmodtrenamet Exceptiontunlink(tfilenametcontentRtomodet copy_modet file_statttfte((s;/usr/lib/python2.7/site-packages/cloudinit/atomic_helper.pyt write_file s*    cCs2t|tj|dddtƒdddd|ƒS(Ntindentit sort_keyss RtwR(R tjsontdumpstTrue(RtdataR((s;/usr/lib/python2.7/site-packages/cloudinit/atomic_helper.pyt write_json*s"( R$tloggingRRR t _DEF_PERMSt getLoggert__name__RRR R((((s;/usr/lib/python2.7/site-packages/cloudinit/atomic_helper.pyts