Skip to content

Commit

Permalink
Build types
Browse files Browse the repository at this point in the history
  • Loading branch information
bskjon committed Jul 6, 2024
1 parent 11549a4 commit 3400e88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions DynamicRoutingUpdater/NetworkAdapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import re
import netifaces
from netaddr import IPAddress
from typing import Optional
from typing import List, Optional
from .objects import IpData, Netstated
import subprocess

Expand Down Expand Up @@ -88,13 +88,13 @@ def getCidr(self, subnet: str) -> Optional[str]:



def parseNetstat(self, nic_name: str) -> list[Netstated]:
def parseNetstat(self, nic_name: str) -> List[Netstated]:
netstat_out = subprocess.getoutput(f"netstat -r -n -e -4 | grep {nic_name}").split("\n")
result = [s for s in netstat_out if s]
if (len(result) == 0):
return []
else:
entries: list[Netstated] = []
entries: List[Netstated] = []
for line in result:
try:
columns = re.split(r'\s+', line)
Expand Down

0 comments on commit 3400e88

Please sign in to comment.