Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/cloudinit/sources/__pycache__/ |
Upload File : |
o x[h;� � @ s d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m Z mZmZm Z mZmZ ddlmZ ddlmZ ddlmZmZmZ dZe�e�ZdZd Zd ZdZdZ d Z!dZ"dZ#dZ$dZ%dZ&dZ'dZ(G dd� dej)�Z*dd� Z+dd� Z,dd� Z-dd� Z.dd � Z/d!d"� Z0d#d$� Z1d%d&� Z2d'd(� Z3d)d*� Z4d+d,� Z5d-d.� Z6d/d � Z7d0d1� Z8d2d3� Z9d4d5� Z:d6d7� Z;d8d9� Z<e*ej=ffe*ej=ej>ffgZ?d:d;� Z@d<d=� ZAdPd?d@�ZBdAdB� ZCdCeDdDeDfdEdF�ZEdCeDdDeDfdGdH�ZFdIdJ� ZGdKdL� ZHdMdN� ZIedOk�reI� dS dS )Qz�Cloud-Init DataSource for VMware This module provides a cloud-init datasource for VMware systems and supports multiple transports types, including: * EnvVars * GuestInfo * IMC (Guest Customization) � N)� atomic_helper�dmi�net�netinfo�sources�util)�loggers)�guestcust_util)�ProcessExecutionError�subp�whichz/sys/class/dmi/id/product_uuidzNo value found�envvar� guestinfo�imc�redactzcleanup-guestinfo� VMX_GUESTINFOz---z local-ipv4z local-ipv6zwait-on-network�ipv4�ipv6c s� e Zd ZdZdZd$dd�Zdeddf� fdd �Zd d� Zdd � Z dd� Z dd� Zdd� Ze dd� �Zdd� Zdd� Zdd� Zdd� Zdd� Zd d!� Zd"d#� Z� ZS )%�DataSourceVMwareav Setting the hostname: The hostname is set by way of the metadata key "local-hostname". Setting the instance ID: The instance ID may be set by way of the metadata key "instance-id". However, if this value is absent then the instance ID is read from the file /sys/class/dmi/id/product_uuid. Configuring the network: The network is configured by setting the metadata key "network" with a value consistent with Network Config Versions 1 or 2, depending on the Linux distro's version of cloud-init: Network Config Version 1 - http://bit.ly/cloudinit-net-conf-v1 Network Config Version 2 - http://bit.ly/cloudinit-net-conf-v2 For example, CentOS 7's official cloud-init package is version 0.7.9 and does not support Network Config Version 2. imc transport: Either Network Config Version 1 or Network Config Version 2 is supported which depends on the customization type. For LinuxPrep customization, Network config Version 1 data is parsed from the customization specification. For CloudinitPrep customization, Network config Version 2 data is parsed from the customization specification. envvar and guestinfo transports: Network Config Version 2 data is supported as long as the Linux distro's cloud-init package is new enough to parse the data. The metadata key "network.encoding" may be used to indicate the format of the metadata key "network". Valid encodings are base64 and gzip+base64. �VMwareNc C sT t j�| ||||� i | _d | _d | _d | _t| jdft | j dft| jdfg| _ d S )NFT)r � DataSource�__init__�cfg�data_access_method�rpctool� rpctool_fn�DATA_ACCESS_METHOD_ENVVAR�get_envvar_data_fn�DATA_ACCESS_METHOD_GUESTINFO�get_guestinfo_data_fn�DATA_ACCESS_METHOD_IMC�get_imc_data_fn� possible_data_access_method_list)�self�sys_cfg�distro�paths�ud_proc� r( �D/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceVMware.pyr ` s �zDataSourceVMware.__init__�ci_pkl_version�returnc s~ t � �|� dD ] }t| |�st| |d � qt| d�s!t| di � t| d�s=t| dt| jdft| jdft| j dfg� d S d S )N)r r r r"