Server IP : 23.254.227.96 / Your IP : 216.73.216.46 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.6/site-packages/cloudinit/sources/__pycache__/ |
Upload File : |
3 ��b@z � @ s� d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlmZ d dlm Z mZmZm Z d dlmZ d dlmZmZ d dlmZ d d lmZ d d lmZ d dlmZ d dlmZ d d lmZ d dl m!Z!m"Z"m#Z#m$Z$m%Z% e j&e'�Z(dZ)dZ*dZ+G dd� dej,�Z-G dd� de-�Z.dd� Z/dDdd�Z0dEdd�Z1dFd d!�Z2d"d#� Z3dGd$d%�Z4d&d'� Z5d(d)� Z6dHd*d+�Z7d,d-� Z8d.d/� Z9d0d1� Z:d2d3� Z;G d4d5� d5e<�Z=e-ej>ffe.ej>ej?fffZ@d6d7� ZAd8d9� ZBd:d;� ZCd<d=� ZDd>d?� ZEd@dA� ZFdBdC� ZGdS )I� N)�minidom)�dmi)�log)�safeyaml�sources�subp�util)�Config)�PostCustomScript�PreCustomScript)� ConfigFile)�NicConfigurator)�PasswordConfigurator)�GuestCustErrorEnum)�GuestCustEventEnum)�GuestCustStateEnum)�enable_nics�get_nics_to_enable�get_tools_config�set_customization_status� set_gc_statusZ deployPkgzenable-custom-scripts�/var/run/vmware-imcc @ sL e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� Zdd � Z e dd� �ZdS )� DataSourceOVFZOVFc C s^ t jj| |||� d | _tjj|jd�| _d | _i | _ d| _ d| _d | _d | _ d | _d| _d S )NZovf�/�file://TF)r r )r � DataSource�__init__�seed�os�path�join�seed_dir�environment�cfg�supported_seed_starts�vmware_customization_supported�_network_config�_vmware_nics_to_enable�_vmware_cust_conf�_vmware_cust_found)�self�sys_cfg�distro�paths� r. �#/usr/lib/python3.6/DataSourceOVF.pyr : s zDataSourceOVF.__init__c C s t jj| �}d|| jf S )Nz%s [seed=%s])r r �__str__r )r* �rootr. r. r/ r0 G s zDataSourceOVF.__str__c / f C s� g }i }d}d}d }d }ddi}t | jj�\}} tjd�} | d krLtjd� |r�tjj | jj|�}t | �\}}}| | _|j|� �n�| o�d| j � k�r*tjd� d} d}| js�tjd � n"tj| jd d� } tj| jdd�}| p�|s�tjd � �n8d>}d}d }x,|D ]$}t||�}|�rtjd|� P �qW |�rVt| j�}tjtjdtd|fd�}n tjd� d }|�r tjj|�}t|�}t|�| _tjd|� yt| j�\}}}W n8 tk �r� } ztd|tj|| j� W Y d d }~X nX |�r�| �r�tjd� d }|d k�r*| �r*tjd� d }n tjd� t |�o4|�}|�r.t!| jd� tjd � y0t"||�\}}}}|�rv|| _#n| j$j%� | _#W np t&j'k �r� } ztd!|t(j)|| j� W Y d d }~X n8 t*k �r� } ztd"|tj|| j� W Y d d }~X nX d| _+|jd#� tj,|� t-t.j/t(j0� t!| jd$� �n�|�r�d| _1y�t!| jd� t2| j�\}}}t3|�| _1| jj4}t5|tjj | jj6d%��}|�o�| }| jj7}|�r�|�r�d&}| jj8�r�tjd'� d(}t9t:t;|�} | j � d(k�r�d)}!tj|!� t-t.j<t(j=� t>|!��tjj | jj?d*�d+�}"W n8 t*k �rL } ztd,|tj|| j� W Y d d }~X nX |�r�|�r�yt@||�}#|#jA� W n8 t*k �r� } ztd-|tj|| j� W Y d d }~X nX y$tjd.� tB| jdd| j$jC�| _#W n8 t*k �r } ztd/|tjD|| j� W Y d d }~X nX |�r�tjd0� tE� }$| jjF}%y4| jjG}&|%�s<|&�rN|$jH|%|&| j$� n tjd1� W n8 t*k �r� } ztd2|tj|| j� W Y d d }~X nX |�r�ytI|||"�}'|'jA� W n8 t*k �r� } ztd3|tj|| j� W Y d d }~X nX |�rHytJ|tjj | jj6d%�� W n8 t*k �rF } ztd4|tj|| j� W Y d d }~X nX d| _+|jd#� tj,tjj|�� tK| j1� t-t.j/t(j0� t!| jd$� nzd5tLfd6tMfg}(d })x |(D ]\})}*|*� } | �r�P �q�W | �r t | d�\}}}| | _d7|k�r |d7 �r |d7 | _#|j|)� tN|�d8k�rdS d9|k�r�|d9 �r�|d9 }+d},x"| jOD ]}-|+jP|-��rD|-},P �qDW |,�sxtjd:|+| � dS tjQ|+d d;�\}.}}tjd<|+� tjR||.g�}|j|+� tjR||g�}d=j |�| _S|| _T|| _U|| _V|| _WdS )?N� zinstance-idz iid-dsovfzsystem-product-namezNo system-product-name found�vmwarez$VMware Virtualization Platform foundFz3Skipping the check for VMware Customization supportZdisable_vmware_customizationT�allow_raw_dataz.Customization for VMware platform is disabled.�/usr/lib/vmware-tools�/usr/lib64/vmware-tools�/usr/lib/open-vm-tools�/usr/lib64/open-vm-tools�'/usr/lib/x86_64-linux-gnu/open-vm-tools�(/usr/lib/aarch64-linux-gnu/open-vm-toolszlibdeployPkgPlugin.soz$Found the customization plugin at %szwaiting for configuration filezcust.cfg)Zlogfunc�msg�func�argsz&Did not find the customization plugin.z,Found VMware Customization Config File at %szFile(s) missing in directoryz)Customization using raw data is disabled.z.Customization using VMware config is disabled.z-Did not find VMware Customization Config FileZStartedz0Start to load cloud-init meta data and user dataz&Error parsing the cloud-init meta dataz&Error loading cloud-init configurationzvmware-toolsZ Successful�dataZfalsez=Set default value to true due to customization configuration.�truez-Custom script is disabled by VM Administrator�scriptszper-instancez+Error parsing the customization Config Filez(Error executing pre-customization scriptz#Preparing the Network configurationz%Error preparing Network ConfigurationzApplying password customizationzChanging password is not neededz%Error applying Password Configurationz)Error executing post-customization scriptzError creating marker fileszcom.vmware.guestInfoZisoznetwork-configr �seedfromz Seed from %s not supported by %s)ZtimeoutzUsing seeded cache data from %s�,)r5 r6 r7 r8 r9 r: )X�get_ovf_envr- r! r � read_dmi_data�LOG�debugr r r �read_ovf_environmentr"