ó 'KXc@sÄddlmZddlZddlmZddlmZddlmZej e ƒZ dZ d ej fd „ƒYZd efd „ƒYZeejfeejejffgZd „ZdS(iÿÿÿÿ(t b64decodeN(tlog(tsources(tCepkotlocaltnettdisabledtDataSourceCloudSigmacBsAeZdZd„Zd„Zeed„Zd„Zd„ZRS(sÍ Uses cepko in order to gather the server context from the VM. For more information about CloudSigma's Server Context: http://cloudsigma-docs.readthedocs.org/en/latest/server_context.html cCs;d|_tƒ|_d|_tjj||||ƒdS(NRt(tdsmodeRtcepkotssh_public_keyRt DataSourcet__init__(tselftsys_cfgtdistrotpaths((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyR %s   cCsd }y |jjƒj}|d}WntjdƒtSX|jd|jƒ}|t krxtj d|ƒd}n|dks“||jkr—tS|jddƒj d ƒ}|jd dƒ|_ d |krèt |j ƒ|_ n||_|d |_tS( sj Metadata is the whole server context and /meta/cloud-config is used as userdata. tmetas+CloudSigma: Unable to read from serial portscloudinit-dsmodes,Invalid dsmode %s, assuming default of 'net'RRt base64_fieldsRt,scloudinit-user-dataR N(tNoneR talltresulttLOGtdebugtFalsetgetR t VALID_DSMODEStwarntsplitt userdata_rawRtmetadataR tTrue(RR tserver_contextt server_metaR((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pytget_data+s(      cCsDtjd|jdƒr(|jdd S|jdjdƒdSdS(s† Cleans up and uses the server's name if the latter is set. Otherwise the first part from uuid is being used. s^[A-Za-z0-9 -_\.]+$tnamei=tuuidt-iN(tretmatchR R(Rtfqdnt resolve_ip((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyt get_hostnameKscCs |jgS(N(R (R((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pytget_public_ssh_keysUscCs |jdS(NR&(R (R((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pytget_instance_idXs( t__name__t __module__t__doc__R R$RR,R-R.(((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyRs    tDataSourceCloudSigmaNetcBseZd„ZRS(cCs#tj||||ƒd|_dS(NR(RR R (RRRR((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyR ]s(R/R0R (((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyR2\scCstj|tƒS(sK Return a list of data sources that match this set of dependencies (Rtlist_from_dependst datasources(tdepends((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pytget_datasource_listjs(slocalsnetsdisabled(tbase64RR(t cloudinitRtloggingRtcloudinit.cs_utilsRt getLoggerR/RRR RR2tDEP_FILESYSTEMt DEP_NETWORKR4R6(((sS/opt/freeware/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudSigma.pyts >