Common: Rename "get_local_interfaces" to "get_network_interfaces"

This commit is contained in:
vakarisz 2022-09-16 15:44:14 +03:00
parent 135da9631d
commit 247441663d
4 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@ def get_my_ip_addresses() -> Sequence[str]:
return ip_list
def get_local_interfaces() -> List[IPv4Interface]:
def get_network_interfaces() -> List[IPv4Interface]:
local_interfaces = []
for interface in interfaces():
addresses = ifaddresses(interface).get(AF_INET, [])

View File

@ -11,7 +11,7 @@ from common import AgentRegistrationData
from common.agent_configuration import AgentConfiguration
from common.common_consts.timeouts import SHORT_REQUEST_TIMEOUT
from common.credentials import Credentials
from common.network.network_utils import get_local_interfaces
from common.network.network_utils import get_network_interfaces
from infection_monkey.i_control_channel import IControlChannel, IslandCommunicationError
from infection_monkey.utils import agent_process
from infection_monkey.utils.ids import get_agent_id, get_machine_id
@ -34,7 +34,7 @@ class ControlChannel(IControlChannel):
# parent_id=parent,
parent_id=None, # None for now, until we change GUID to UUID
cc_server=self._control_channel_server,
network_interfaces=get_local_interfaces(),
network_interfaces=get_network_interfaces(),
)
try:

View File

@ -17,8 +17,8 @@ from common.event_serializers import (
from common.events import CredentialsStolenEvent
from common.network.network_utils import (
address_to_ip_port,
get_local_interfaces,
get_my_ip_addresses,
get_network_interfaces,
)
from common.utils.argparse_types import positive_int
from common.utils.attack_utils import ScanStatus, UsageEnum
@ -224,7 +224,7 @@ class InfectionMonkey:
return agent_event_serializer_registry
def _build_master(self, relay_servers: List[str]):
local_network_interfaces = get_local_interfaces()
local_network_interfaces = get_network_interfaces()
# TODO control_channel and control_client have same responsibilities, merge them
propagation_credentials_repository = AggregatingPropagationCredentialsRepository(

View File

@ -3,7 +3,7 @@ from typing import Sequence
from ring import lru
from common.network.network_utils import get_local_interfaces, get_my_ip_addresses
from common.network.network_utils import get_my_ip_addresses, get_network_interfaces
@lru(maxsize=1)
@ -17,4 +17,4 @@ def get_cached_local_ip_addresses() -> Sequence[IPv4Address]:
# change, the Island process needs to be restarted.
@lru(maxsize=1)
def get_cached_local_interfaces() -> Sequence[IPv4Interface]:
return get_local_interfaces()
return get_network_interfaces()