ó oBú]c@sâdZddlmZddlmZddlmZddlmZddljj j Z ej e ƒZdZiedd 6ed d 6Zd Zd Zd Zdejfd„ƒYZd„ZeejffgZd„ZdS(s?Hetzner Cloud API Documentation. https://docs.hetzner.cloud/iÿÿÿÿ(tlog(tnet(tsources(tutilNs!http://169.254.169.254/hetzner/v1s /metadatat metadata_urls /userdatat userdata_urli<itDataSourceHetznercBs/eZdZd„Zd„Zed„ƒZRS(tHetznercCsÜtjj||||ƒ||_tƒ|_tjtj|ddgiƒt gƒ|_ |j d|_ |j d|_ |j j dtƒ|_|j j dtƒ|_|j j dtƒ|_d|_tj|_dS(Nt datasourceRRRtretriesttimeoutt wait_retry(Rt DataSourcet__init__tdistrotdicttmetadataRt mergemanydicttget_cfg_by_pathtBUILTIN_DS_CONFIGtds_cfgtmetadata_addresstuserdata_addresstgett MD_RETRIESR t MD_TIMEOUTR t MD_WAIT_RETRYR tNonet_network_configtDSMODE_NETWORKtdsmode(tselftsys_cfgRtpaths((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pyR "s   c Cstƒs tStjƒ}tj|dddƒ_tj|jd|jd|j d|j ƒ}tj |j d|jd|j d|j ƒ}WdQX||_ ||_|d|jd<|d|jd <|jd dƒ|jd <|jd dƒ|jd <|jd dƒ|_tS( Ns 169.254.0.1is169.254.255.255R t sec_betweenR s instance-idthostnameslocal-hostnamesnetwork-configs public-keyst vendor_data(t on_hetznertFalsetcloudnettfind_fallback_nictEphemeralIPv4Networkt hc_helpert read_metadataRR R R t read_userdataRt userdata_rawt metadata_fullRRRtvendordata_rawtTrue(Rtnictmdtud((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pytget_data1s&     cCsB|jr|jS|jd}|s2tdƒ‚n||_|jS(s¥Configure the networking. This needs to be done each boot, since the IP information may have changed due to snapshot and/or migration. snetwork-configs'Unable to get meta-data from server....(RRt Exception(Rt _net_config((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pytnetwork_configLs   (t__name__t __module__tdsnameR R4tpropertyR7(((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pyRs  cCstjdƒdkS(Nssystem-manufacturerR(Rt read_dmi_data(((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pyR%_scCstj|tƒS(N(Rtlist_from_dependst datasources(tdepends((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pytget_datasource_listjs(t__doc__t cloudinitRtloggingRR'RRt!cloudinit.sources.helpers.hetznerthelpersthetznerR*t getLoggerR8tLOGt BASE_URL_V1RRRRR RR%tDEP_FILESYSTEMR>R@(((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceHetzner.pyts" A