oB]c@sddlZddlZddlZddlmZmZmZddlmZddlm Z ddlm Z ddlm Z e j eZdZdZd Zd ZeegZd gZd Zd Zi dd6dd6dd6dd6dd6d d6dd6dd6dd6dd 6Zeeejd!d"Zejejd#efd$YZ d%Z!d&Z"d'Z#d(Z$d)Z%d*Z&d+Z'd,Z(ed-Z)dd.Z+dS(/iN(t PER_ALWAYSt PER_INSTANCEt FREQUENCIES(timporter(tlog(t type_utils(tutilstext/x-not-multipartsapplication/octet-streamt__end__t __begin__stext/part-handlerspart-handler-%03ds part-%03dstext/x-include-urls#includestext/x-include-once-urls #include-oncestext/x-shellscripts#!stext/cloud-configs #cloud-configstext/upstart-jobs #upstart-jobs #part-handlerstext/cloud-boothooks#cloud-boothookstext/cloud-config-archives#cloud-config-archivestext/cloud-config-jsonps#cloud-config-jsonps text/jinja2s## template: jinjatkeycCsdt|S(Ni(tlen(te((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt<stHandlercBs8eZddZdZdZejdZRS(icCs||_||_dS(N(thandler_versiont frequency(tselfRtversion((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt__init__Bs cCsdtj||jfS(Ns%s: [%s](Rtobj_namet list_types(R((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt__repr__FscCsFt|dstdn$gt|dD]}t|^q.SdS(Ntprefixess#Missing prefixes subclass attribute(thasattrtNotImplementedErrortgetattrtINCLUSION_TYPES_MAP(Rtprefix((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyRIscOs tdS(N(R(Rtargstkwargs((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt handle_partQs(t__name__t __module__RRRtabctabstractmethodR(((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyR ?s   c CsV|j}|tkp*|tko*|tks1dSy|j}t|}Wn tttfk rld}nX|d}ytj d||||||dkr|j ||||||n]|dkr|j |||||n5|dkr|j ||||ntd|Wn0t k rQt j td|||||nXdS(Nis Content-Types1Calling handler %s (%s, %s, %s) with frequency %siisUnknown module version %ss8Failed calling handler %s (%s, %s, %s) with frequency %s(RRRRtintt TypeErrort ValueErrortAttributeErrortLOGtdebugRt ExceptionRtlogexc( tmodtdatatfilenametpayloadRtheaderstmod_freqtmod_vert content_type((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pytrun_partVs4             cCs*itd6}t||dd||dS(Ns Content-Type(t CONTENT_STARTR3tNone(R+R,RR/((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt call_beginxs cCs*itd6}t||dd||dS(Ns Content-Type(t CONTENT_ENDR3R5(R+R,RR/((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pytcall_ends c Cs|d}t|}|d}tjj|dd|}|jdsWd|}ntj||d|d}yNttj |} t | |d ||j | d t |d |dRQtcloudinit.settingsRRRt cloudinitRRtloggingRRt getLoggerRR'RcRkR7R4tCONTENT_SIGNALSRbR=RmRtsortedtlisttkeysR{t add_metaclasstABCMetatobjectR R3R6R8RMRYR_RfRhRCR5R(((s?/usr/lib/python2.7/site-packages/cloudinit/handlers/__init__.pyt sR        "