File: //usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyc
�
d�bc @ s� d Z d d l Z d d l Z d d l Z d d l j j Z d d l j j Z d d l
m Z d d l m
Z
d d l j j j Z d d l m Z m Z m Z m Z d Z d Z d Z d � Z d
e f d � � YZ d S( sB
Copy and parse ovf-env.xml from provisioning ISO and local cache
i����N( t
ProtocolError( t ustr( t parse_doct findallt findt findtexts 1.0s) http://schemas.dmtf.org/ovf/environment/1s) http://schemas.microsoft.com/windowsazurec C s( | d k r$ t d j | � � � n d S( Ns Failed to validate OVF: {0}( t NoneR t format( t valt msg( ( sJ /usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyt
_validate_ovf$ s t OvfEnvc B s e Z d Z d � Z d � Z RS( sO
Read, and process provisioning info from provisioning file OvfEnv.xml
c C s� | d k r t d � � n t j d � d | _ d | _ d | _ d | _ t | _ g | _
g | _ d | _ | j
| � d S( Ns ovf-env is Nones Load ovf-env.xml( R t
ValueErrort loggert verboset hostnamet usernamet
user_passwordt
customdatat Truet disable_ssh_password_autht ssh_pubkeyst ssh_keypairst provision_guest_agentt parse( t selft xml_text( ( sJ /usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyt __init__- s
c C s� t } t } t | � } t | d d | �} t | d � t | d d | �} t | d � t | d d | �} t | d � | t k r� t j d � n t | d d | �} t | d
� t | d d | �| _ t | j d � t | d
d | �| _
t | j
d � t | d d | �| _ t | d d | �| _ t | d d | �} | d k r{| j � d k r{t | _ n t | _ t | d d | �}
xf |
D]^ } t | d d | �} t | d d | �}
t | d d | �} | j j | |
| f � q�Wt | d d | �} xN | D]F } t | d d | �} t | d d | �}
| j j | |
f � qWt | d d | �} t | d � t | d d | �} t | d � t | d d | �| _ t | j d � d S( s_
Parse xml tree, retreiving user and ssh key information.
Return self.
t Environmentt namespaces Environment not foundt ProvisioningSections ProvisioningSection not foundt Versions Version not foundsK Newer provisioning configuration detected. Please consider updating waagentt! LinuxProvisioningConfigurationSets+ LinuxProvisioningConfigurationSet not foundt HostNames HostName not foundt UserNames UserName not foundt UserPasswordt
CustomDatat DisableSshPasswordAuthenticationt truet PublicKeyt Patht Fingerprintt Valuet KeyPairt PlatformSettingsSections! PlatformSettingsSection not foundt PlatformSettingss PlatformSettings not foundt ProvisionGuestAgents ProvisionGuestAgent not foundN( t
WA_NAME_SPACEt OVF_NAME_SPACER R R
R t OVF_VERSIONR
t warnR R R R R t lowerR R t FalseR R t appendR R ( R R t wanst ovfnst xml_doct environmentt sectiont versiont conf_sett auth_optiont public_keyst
public_keyt patht fingerprintt valuet keypairst keypairt platform_settings_sectiont platform_settings( ( sJ /usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyR ; sT
( t __name__t
__module__t __doc__R R ( ( ( sJ /usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyR ) s ( RI t ost ret shutilt xml.dom.minidomt domt minidomt azurelinuxagent.common.loggert commonR
t azurelinuxagent.common.exceptionR t azurelinuxagent.common.futureR t% azurelinuxagent.common.utils.fileutilt utilst fileutilt% azurelinuxagent.common.utils.textutilR R R R R1 R0 R/ R
t objectR ( ( ( sJ /usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/ovfenv.pyt <module> s "