Server IP : 23.254.227.96 / Your IP : 216.73.216.7 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/config/__pycache__/ |
Upload File : |
3 ��bf* � @ sj d Z ddlZddlmZ ddlmZmZ dgZeje �Z dZdd� Zd d � Z dd� Zd d� Zddd�ZdS )a� LXD --- **Summary:** configure lxd with ``lxd init`` and optionally lxd-bridge This module configures lxd with user specified options using ``lxd init``. If lxd is not present on the system but lxd configuration is provided, then lxd will be installed. If the selected storage backend is zfs, then zfs will be installed if missing. If network bridge configuration is provided, then lxd-bridge will be configured accordingly. **Internal name:** ``cc_lxd`` **Module frequency:** per instance **Supported distros:** ubuntu **Config keys**:: lxd: init: network_address: <ip addr> network_port: <port> storage_backend: <zfs/dir> storage_create_device: <dev> storage_create_loop: <size> storage_pool: <name> trust_password: <password> bridge: mode: <new, existing or none> name: <name> ipv4_address: <ip addr> ipv4_netmask: <cidr> ipv4_dhcp_first: <ip addr> ipv4_dhcp_last: <ip addr> ipv4_dhcp_leases: <size> ipv4_nat: <bool> ipv6_address: <ip addr> ipv6_netmask: <cidr> ipv6_nat: <bool> domain: <domain> � N)�log)�subp�utilZubuntuZlxdbr0c C s� |j d�}|s|jd| � d S t|t�s<|jdt|�� d S |j d�}t|t�sd|jdt|�� i }|j di �}t|t�s�|jdt|�� i }g }tjd�s�|jd� |j d�d kr�tjd � r�|jd � t |��ry|j j|� W n2 tjk �r } z|jd|| � d S d } ~ X nX |�r�d(} tjdddg� dddg}x>| D ]6}|j |��rB|j d|jdd�t|| �f g� �qBW tj|� d} |�r�|j dt�}tjjd��rHtj| ��rHt|�}y<|jd| � djdd� |j� D ��d }tjdg|� W n& tk �r tj|d| � Y nX tjd� |jd � tjd!dd"g� nlt|�\}}t|t|�t|�t|�d#� |�r�|jd$d%j|� � t|� |�r�|jd&d%j|� � t|� n|�r�td'| ��d S ))NZlxdz8Skipping module named %s, not present or disabled by cfgz-lxd config must be a dictionary. found a '%s'Zinitz2lxd/init config must be a dictionary. found a '%s'Zbridgez4lxd/bridge config must be a dictionary. found a '%s'�storage_backendZzfszzfsutils-linuxz!failed to install packages %s: %s�network_address�network_port�storage_create_device�storage_create_loop�storage_pool�trust_passwordZ waitreadyz --timeout=300z--autoz--%s=%s�_�-zdebconf-communicate�namez/etc/default/lxd-bridgezSetting lxd debconf via � c S s g | ]\}}d ||f �qS )z set %s %s� )�.0�k�vr r �/usr/lib/python3.6/cc_lxd.py� <listcomp>� s zhandle.<locals>.<listcomp>zFailed to run '%s' for lxd withz Running dpkg-reconfigure for lxdzdpkg-reconfigurez--frontend=noninteractive)�net_name�did_init�create�attachzCreating lxd bridge: %s� z!Setting up default lxd bridge: %sz*Unable to configure lxd bridge without %s.)r r r r r r r ) �get�debug� isinstance�dictZwarning�typer Zwhich�append�lenZdistroZinstall_packages�ProcessExecutionError�extend�replace�str�_DEFAULT_NETWORK_NAME�os�path�exists�bridge_to_debconf�join�items� Exceptionr ZlogexcZdel_file� bridge_to_cmd�maybe_cleanup_default�bool�_lxc�RuntimeError)r ZcfgZcloudr �argsZlxd_cfgZinit_cfg� bridge_cfgZpackages�excZ init_keys�cmdr Z dconf_commr �debconf�data� cmd_create� cmd_attachr r r �handle>