| Server IP : 159.223.102.202 / Your IP : 216.73.216.195 Web Server : nginx/1.26.0 System : Linux Gen1-cloudpanel2ubuntu2404-1vcpu-1gb-nyc1-01 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64 User : albasshbotta ( 1021) PHP Version : 8.2.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /usr/share/netplan/netplan_cli/cli/__pycache__/ |
Upload File : |
�
*C�e"q � � � d dl mZ d dlZd dlZd dlmZ d dlmZ d dlm Z m
Z
mZ d dlm
Z
mZ G d� dej � Z G d � d
� Zy)� )�defaultdictN)�AbstractSet)�NetplanRoute)�SystemConfigState�NetplanConfigState�DEVICE_TYPES)�is_valid_macaddress�route_table_lookupc � � e Zd Zd� Zy)�DiffJSONEncoderc � � t |t � r|j � S t j j | |� S �N)�
isinstancer �to_dict�json�JSONEncoder�default)�self�objs �0/usr/share/netplan/netplan_cli/cli/state_diff.pyr zDiffJSONEncoder.default s3 � ��c�<�(��;�;�=� � ���'�'��c�2�2� N)�__name__�
__module__�__qualname__r � r r r r s � �3r r c � � e Zd ZdZdedefd�Zdefd�Zd*de defd�Z
defd �Zd
e de dedefd�Z
d
ededdfd�Zdedefd�Zdedefd�Zde de fd�Zd
ededdfd�Zd
ededdfd�Zd
ededdfd�Zd
ededdfd�Zdede ddfd�Zd
ededdfd�Zdedefd�Zd ee d!ee d
edefd"�Zdefd#�Zdeddfd$�Zdefd%�Z d&edefd'�Z!d(e defd)�Z"y)+�NetplanDiffStatez�
DiffState is mainly responsible for getting both system's and Netplan's configuration
state, compare them and provide a data-structure containing the differences it found.
�system_state�
netplan_statec �. � || _ || _ i | _ y r )r r �route_lookup_table_names)r r r s r �__init__zNetplanDiffState.__init__+ s � �(���*���(*��%r �returnc � � di i}| j � }| j � }t t |j � � t |j � � z � }|D ]
}i |d |<