8889841có oBú]c@sddlZddlZddlmZddlmZddlmZddlmZej e ƒZ dej fd„ƒYZ dd„Zdd „Zdd „Zd „Zd „Zd e fd„ƒYZe ejffeejejffgZd„ZdS(iÿÿÿÿN(tlog(teni(tsources(tutiltDataSourceNoCloudcBskeZdZd„Zd„Zd„Zd„Zed„ƒZd„Z d„Z d„Z ed „ƒZ RS( tNoCloudcCsktjj||||ƒd|_tjj|jdƒtjj|jdƒg|_ d|_d|_ dS(Ntnoclouds nocloud-nett/sfile://(Rsfile://( Rt DataSourcet__init__tNonetseedtostpathtjointseed_dirt seed_dirstsupported_seed_starts(tselftsys_cfgtdistrotpaths((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceNoCloud.pyR s   cCs)tjj|ƒ}d||j|jfS(Ns%s [seed=%s][dsmode=%s](RRt__str__R tdsmode(Rtroot((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceNoCloud.pyR"scCsötjƒrHgd|d|gD]}tjj|ƒr!|^q!}nªtjddƒtjddƒtjdƒ}|jtjdƒƒtjd|jƒƒ}|jtjd|jƒƒƒt t |ƒt |ƒ@ƒ}|j d t ƒ|S( Ns /dev/msdosfs/s /dev/iso9660/R s/dev/sr0s/dev/sr1s TYPE=vfats TYPE=iso9660sLABEL=%streverse( Rt is_FreeBSDR R texiststfind_devs_withtextendtuppertlowertlisttsettsorttTrue(Rtlabeltptdevlisttfslistt label_list((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceNoCloud.pyt _get_devices&s ! cCsëidd6|jd6}g}iid6dd6dd6dd6}yTi}tjd ƒ}|r’t||ƒr’|jd ƒt|i|d6ƒ}nWn"tk r·tjt d ƒt SXy<i}t|ƒró|jd ƒt|i|d6ƒ}nWn"tk rtjt d ƒt SXiddgd6ddgd6}xh|j D]]}yCtj ||}|j|ƒt j d|ƒt||ƒ}PWqCtk rŸqCXqCW|jjdƒrÛ|jdƒ|jd|ddR#( tds_idR}R,targlinettokttmptkvpairsts2ltitemtktv((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceNoCloud.pyRs4          cCstƒ}|jd|ƒ}||kr+|Sd}t|tƒsWtj|d|ƒ|Stt|jƒƒƒdkrŒtj|d|ƒ|S|jdƒdkr·tj|d|ƒn5t d|kd |kfƒsìtj|d |ƒ|Stj|d |ƒ|S( sMIf network-config contains top level 'network' key, then remove it. Some providers of network configuration may provide a top level 'network' key (LP: #1798117) even though it is not necessary. Be friendly and remove it if it really seems so. Return the original value if no change or the updated value if changed.tnetworks.Top level network key in network-config %s: %sswas not a dictishad multiple top level keystconfigtdisabledswas config/disabledtversions!but missing 'config' or 'version's#fixed by removing shifting network.( tobjectREt isinstancetdictR@RBRLR tkeystall(tcfgtnullvalt network_valtbmsg((sG/usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceNoCloud.pyt_maybe_remove_top_networkBs$  cCsÖ|jƒ}|jdiƒ}t|dtƒsGtj|dƒ}ntj|d|gƒ|d<|jdƒr˜ttj|jdƒƒƒ|d s  Û   (