0x1949 Team - FAZEMRX - MANAGER
Edit File: DataSourceOVF.cpython-310.pyc
o ���f�2 � @ s d Z ddlZddlZddlZddlZddlmZ ddlZddlm Z m Z mZ e�e �ZG dd� de j�ZG dd� de�Zd#d d�Zdd � Zdd� Zd$dd�Zdd� Zdd� Zdd� Zdd� Zdd� ZG dd� de�Zee jffee je jfffZdd � Z d!d"� Z!dS )%zZCloud-Init DataSource for OVF This module provides a cloud-init datasource for OVF data. � N)�minidom)�sources�subp�utilc @ sL e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z e dd� �ZdS )� DataSourceOVF�OVFc C sF t j�| |||� d | _tj�|jd�| _d | _i | _ d| _ d | _d S )N�ovf)�/zfile://)r � DataSource�__init__�seed�os�path�join�seed_dir�environment�cfg�supported_seed_starts�_network_config��self�sys_cfg�distro�paths� r �A/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceOVF.pyr s zDataSourceOVF.__init__c C s t j�| �}d|| jf S )Nz%s [seed=%s])r r �__str__r )r �rootr r r r ) s zDataSourceOVF.__str__c C s� g }i }d}d}ddi}t | jj�\}}|r/tj�| jj|�}t|�\}}} || _|�|� n7dt fdt fg} d }| D ]\}}|� }|rF nq;|rft|d�\}}} || _d|v ra|d ra|d | _|�|� t|�dkrnd S d |v r�|d r�|d } d }| j D ]}| �|�r�|} nq|s�t�d| | � d S tj| d d�\}}}}t�d | � t�||g�}|�| � t�||g�}d�|�| _|| _|| _|| _| | _dS )N� �instance-idz iid-dsovfzcom.vmware.guestInfo�isoT�network-configr F�seedfromz Seed from %s not supported by %s)�timeoutzUsing seeded cache data from %s�,)�get_ovf_envr r r r r �read_ovf_environmentr �append�transport_vmware_guestinfo�transport_iso9660r �lenr � startswith�LOG�debugr �read_seeded� mergemanydictr �metadata�userdata_raw�vendordata_rawr )r �found�md�ud�vd�defaults�seedfile�contentsr r �np�name� transfuncr"