U
    Ӈge	                     @   sT   d dl Z d dlmZmZ d dlmZ d dlmZ e e	Z
dZG dd dejZdS )    N)subputil)rhel)CLOUDINIT_NETPLAN_FILEa7  # This file is generated from information provided by the datasource.  Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
c                       s*   e Zd ZdZ fddZdddZ  ZS )Distroz/usr/libc                    sb   t  ||| d| _d| _d| _d| _dg| _dti| _| j| jd| jd t	dd	d
| _
d S )NZ
azurelinuxz/etc/systemd/network/z/etc/locale.confz/etc/systemd/resolved.confZ	systemctlnetplan)Zresolv_conf_fnnetwork_conf_dirTrue)Znetplan_pathZnetplan_headerZpostcmds)Znetworkdr   )super__init__Zosfamilyr   Zsystemd_locale_conf_fnZresolve_conf_fnZinit_cmdr   Znetwork_conf_fnNETWORK_FILE_HEADERZrenderer_configs)selfnameZcfgpaths	__class__ >/usr/lib/python3/dist-packages/cloudinit/distros/azurelinux.pyr      s    
zDistro.__init__Nc                 C   s   |d krg }t dr(td dg}ntd dg}|d |r\t|tr\|| n|rtt|trt|| || t	
d|}|| t j |dd d S )	NZdnfz Using DNF for package managementz!Using TDNF for package managementZtdnfz-yz%s-%sF)Zcapture)r   ZwhichLOGdebugappend
isinstancestrlistextendr   Zexpand_package_list)r   ZcommandargsZpkgscmdZpkglistr   r   r   package_command1   s     






zDistro.package_command)NN)__name__
__module____qualname__Zusr_lib_execr   r   __classcell__r   r   r   r   r      s   r   )ZloggingZ	cloudinitr   r   Zcloudinit.distrosr   Zcloudinit.net.netplanr   Z	getLoggerr   r   r   r   r   r   r   r   <module>   s   
	