Skip to content

Commit 731c833

Browse files
mchrominabaczek
authored andcommitted
feat: MFD Const Internal introduction.
Signed-off-by: Mateusz Chrominski <[email protected]>
1 parent 5a92978 commit 731c833

File tree

5 files changed

+29
-5
lines changed

5 files changed

+29
-5
lines changed

mfd_network_adapter/network_adapter_owner/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,18 @@
1010
from typing import List, Optional, Union
1111

1212
from mfd_common_libs import log_levels, add_logging_level
13-
from mfd_const import SPEED_IDS, DEVICE_IDS, MANAGEMENT_NETWORK, Family, Speed
13+
from mfd_const import MANAGEMENT_NETWORK, Family, Speed
1414
from mfd_typing import OSName, PCIDevice, PCIAddress, VendorID
1515
from mfd_typing.network_interface import InterfaceInfo, WindowsInterfaceInfo, LinuxInterfaceInfo
1616

1717
from .exceptions import NetworkAdapterConnectedOSNotSupported, NetworkAdapterIncorrectData
1818
from ..network_interface.base import NetworkInterface
1919

20+
try:
21+
from mfd_const_internal import SPEED_IDS, DEVICE_IDS
22+
except ImportError:
23+
from mfd_const import SPEED_IDS, DEVICE_IDS
24+
2025
if typing.TYPE_CHECKING:
2126
from mfd_connect import Connection
2227
from mfd_connect.base import ConnectionCompletedProcess

mfd_network_adapter/network_adapter_owner/esxi.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from funcy import walk_values, partial
1212
from mfd_common_libs import TimeoutCounter, add_logging_level, log_levels
13-
from mfd_const import SPEED_IDS, DEVICE_IDS, Family, Speed
13+
from mfd_const import Family, Speed
1414
from mfd_typing import PCIDevice, PCIAddress, MACAddress, DeviceID
1515
from mfd_typing import VendorID
1616
from mfd_typing.network_interface import InterfaceInfo
@@ -20,6 +20,11 @@
2020
from ..network_interface.esxi import ESXiNetworkInterface
2121
from ..network_interface.feature.link import LinkState
2222

23+
try:
24+
from mfd_const_internal import SPEED_IDS, DEVICE_IDS
25+
except ImportError:
26+
from mfd_const import SPEED_IDS, DEVICE_IDS
27+
2328
if TYPE_CHECKING:
2429
from mfd_connect import Connection
2530
from .. import NetworkInterface

mfd_network_adapter/network_adapter_owner/linux.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
from funcy import walk_values, partial
1414
from mfd_common_libs import os_supported, log_levels, add_logging_level
15-
from mfd_const.mfd_const import MEV_IDs
1615
from mfd_kernel_namespace import add_namespace_call_command
1716
from mfd_typing import PCIDevice, PCIAddress, OSName, MACAddress
1817
from mfd_typing.network_interface import LinuxInterfaceInfo, InterfaceType, VlanInterfaceInfo
@@ -27,6 +26,11 @@
2726
from ..exceptions import VlanNotFoundException, NetworkAdapterModuleException
2827
from ..network_interface.exceptions import MacAddressNotFound
2928

29+
try:
30+
from mfd_const_internal.mfd_const import MEV_IDs
31+
except ImportError:
32+
from mfd_const.mfd_const import MEV_IDs
33+
3034
if TYPE_CHECKING:
3135
from pathlib import Path
3236

mfd_network_adapter/network_interface/base.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from typing import Optional, Union, Any
1111

1212
from mfd_common_libs import add_logging_level, log_levels
13-
from mfd_const import Family, DEVICE_IDS, Speed, SPEED_IDS
13+
from mfd_const import Family, Speed
1414
from mfd_typing import MACAddress, PCIAddress, OSName, PCIDevice
1515
from mfd_typing.network_interface import (
1616
InterfaceType,
@@ -23,6 +23,11 @@
2323

2424
from ..stat_checker import StatChecker
2525

26+
try:
27+
from mfd_const_internal import SPEED_IDS, DEVICE_IDS
28+
except ImportError:
29+
from mfd_const import SPEED_IDS, DEVICE_IDS
30+
2631
if typing.TYPE_CHECKING:
2732
from mfd_model.config import NetworkInterfaceModelBase
2833
from mfd_connect import Connection

mfd_network_adapter/network_interface/feature/interrupt/windows.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
StatusToQuery,
2121
)
2222
from .const import timestamp_data_pattern
23-
from mfd_const import Speed, DEVICE_IDS
23+
from mfd_const import Speed
2424
from mfd_network_adapter.network_interface.feature.utils.base import BaseFeatureUtils
2525
from mfd_network_adapter.network_interface.feature.ip.data_structures import IPFlag
2626
from mfd_typing.utils import strtobool
@@ -32,6 +32,11 @@
3232

3333
from .base import BaseFeatureInterrupt
3434

35+
try:
36+
from mfd_const_internal import DEVICE_IDS
37+
except ImportError:
38+
from mfd_const import DEVICE_IDS
39+
3540
if TYPE_CHECKING:
3641
from mfd_connect import Connection
3742
from mfd_network_adapter import NetworkInterface

0 commit comments

Comments
 (0)