oB]c @sddlZddlZddlmZddlmZddlmZddlm Z ddlm Z ddlm Z ej e ZdZied 6Zd5Zd ZdZidd6ZdefdYZde jfdYZdZdZddZdedZdZee j e j!ffgZ"dZ#e dkrddl$Z$ddl%Z%ddlm&Z&e$j'ddZ(e(j)dd d!d"d#d$ee(j)d%d&d'd"d(d)d*d$ee(j*Z+ed+e+j,d'e+j-Z.d,e.kr_ye.d,j/e.d,st:iit cloudinit(tallRLtlenRptappend(RFR(t public_keysRitsplit_public_keytuserRI((sC/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceGCE.pyREs  c Cs5|dkrt}nidd6dd6td6dd6}t|d<|rc|d rcd|d<|Stj|stjd|d||d<|Sd d"tttfd d#tttfd d$tttfdd%tttfdd&tttfg}t |}i}x|D]\}}}} } d} x8|D]0} |j | | | } | dk r/| } q/q/W|r| dkrd}|||d<|S| ||(R8tplatform_checkRAturl_maptmetadata_fetchertmdtmkeyR3trequiredRRRRt new_valueRt instance_datat project_datat valid_keyst block_projectRIRFtudtencoding((sC/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceGCE.pyR=sh        (      cCsdtjdpd}|dkr%tStjdp7d}|jdrMtStjd||tS(Nssystem-product-namesN/AsGoogle Compute Enginessystem-serial-numbers GoogleCloud-s6Not running on google cloud. product-name=%s serial=%s(Rt read_dmi_dataR@t startswithRRR#(tpnametserial((sC/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceGCE.pyR:s   cCstj|tS(N(Rtlist_from_dependst datasources(tdepends((sC/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceGCE.pytget_datasource_listst__main__(t b64encodet descriptionsQuery GCE Metadata Services --endpointtmetavartURLthelps The url of the metadata service.tdefaults--no-platform-checktdestRsIgnore smbios platform checktactiont store_falseR8s user-datas/User-data cannot be decoded. Writing as base64 s user-data-b64tindentit sort_keyst separatorst,s: (s instance-idsavailability-zoneslocal-hostname(Rs: (4RfRdRRtcloudinit.distrosRRuRtloggingRRRt getLoggerR!RRR/tREQUIRED_FIELDSR[R\RtobjectR R'R$RHRpRRER@R=R:tDEP_FILESYSTEMt DEP_NETWORKRRtargparsetsysRtArgumentParsertparsert add_argumentt parse_argstargstendpointRRWRtUnicodeDecodeErrortstderrtwritetdumps(((sC/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceGCE.pytsX    < " H         !