File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/win_network.cpython-310.pyc
Back
o ;j�N � @ s d Z ddlZddlZddlZddlmZ e�� dkZe� e �ZdZerrej jjdddd �Zed r7ed dk r:d ZndZerGddlZddlZn+zddlZddlmZ ddlmZ W n eyq e�d� d ZddlZddlZY nw i dd�dd�dd�dd�dd�dd�dd�d d!�d"d#�d$d%�d&d'�d(d)�d*d+�d,d-�d.d/�d0d1�d2d3�d4d5d6d7d8d9d:d;d<d=d>d?d@��ZdAdBdCddDdEdFdG�ZdHdIdJdKdLdMdN�ZdOZdZdPdQ� Z dRdS� Z!dTdU� Z"dVdW� Z#dXdY� Z$dZd[� Z%d\d]� Z&d^d_� Z'd`da� Z(dbdc� Z)ddde� Z*dfdg� Z+dhdi� Z,djdk� Z-dS )la6 This salt util uses WMI to gather network information on Windows 7 and .NET 4.0+ on newer systems. The reason for this is that calls to WMI tend to be slower. Especially if the query has not been optimized. For example, timing to gather NIC info from WMI and .NET were as follows in testing: WMI: 3.4169998168945312 seconds NET: 1.0390000343322754 seconds Since this is used to generate grain information we want to avoid using WMI as much as possible. There are 3 functions in this salt util. - get_interface_info_dot_net - get_interface_info_wmi - get_interface_info The ``get_interface_info`` function will call one of the other two functions depending on the version of Windows this is run on. Once support for Windows 7 is dropped we can remove the WMI stuff and just use .NET. :depends: - pythonnet - wmi � N)� ipaddress�WindowsZwin_networkZHKLMz2SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\FullZRelease)Zhive�keyZvname�successZvdatai� TF)�NetworkInformation)�NetworkInterfaceComponentz-Failed to load pythonnet. Falling back to WMI� ZUnknown� ZEthernet� Z TokenRing� ZFDDI� Z BasicISDN� ZPrimaryISDN� ZPPP� �Loopback� ZEthernet3Megabit� ZSlip�% ZATM�0 ZGenericModem�5 Z TAPAdapter�>