ó oBú]c@s¼ddlZddlZddlZddlmZddlmZddlmZddlm Z ej e ƒZ dZidej6dej6dej6Zd „Zd „Zd „ZdS(iÿÿÿÿN(tStringIO(tlog(tutil(tversionis2Cloud-init %(version)s received SIGINT, exiting...is3Cloud-init %(version)s received SIGTERM, exiting...s3Cloud-init %(version)s received SIGABRT, exiting...cCs ||ks| rdStj|ƒ}d|d}|jd||jfƒ|jd||jfƒ|jd||jfƒt|j|d||ƒdS(Nt is%sFilename: %s s%sFunction: %s s%sLine number: %s i(tinspectt getframeinfotwritetfilenametfunctiontlinenot _pprint_frametf_back(tframetdeptht max_depthtcontentst frame_infotprefix((s</usr/lib/python2.7/site-packages/cloudinit/signal_handler.pyR scCsŠt|\}}|itjƒd6}tƒ}|jd|ƒt|dt|ƒtj|j ƒdt dt dt ƒt j|ƒdS(NRs%s itconsoletstderrR(tEXIT_FORtvrtversion_stringRRR tBACK_FRAME_TRACE_DEPTHRt multi_logtgetvaluetTruetFalsetLOGtsystexit(tsignumR tmsgtrcR((s</usr/lib/python2.7/site-packages/cloudinit/signal_handler.pyt _handle_exit+s cCsAd}x$tjƒD]}tj|tƒqW|ttƒ7}|S(Ni(RtkeystsignalR#tlen(t sigs_attachedR ((s</usr/lib/python2.7/site-packages/cloudinit/signal_handler.pytattach_handlers6s (s2Cloud-init %(version)s received SIGINT, exiting...i(s3Cloud-init %(version)s received SIGTERM, exiting...i(s3Cloud-init %(version)s received SIGABRT, exiting...i(RR%RtsixRt cloudinitRtloggingRRRt getLoggert__name__RRtSIGINTtSIGTERMtSIGABRTRR R#R((((s</usr/lib/python2.7/site-packages/cloudinit/signal_handler.pyt s