Skip to content

Commit 8229622

Browse files
authored
Merge pull request #239 from CybercentreCanada/hotfix/pyroute2_import
Switch from pyroute2 to pyroute2.core
2 parents e53e7dc + df00f87 commit 8229622

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

assemblyline/common/net.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from random import randint
66

77
import netifaces as nif
8-
import pyroute2
8+
import pr2modules.iproute as iproute
99

1010
from assemblyline.common.net_static import TLDS_ALPHA_BY_DOMAIN
1111

@@ -94,7 +94,7 @@ def get_random_mac(seperator: str = ':') -> str:
9494
def get_route_to(dst: str) -> str:
9595
ret_val = None
9696
try:
97-
with pyroute2.IPRoute() as ipr:
97+
with iproute.IPRoute() as ipr:
9898
for k, v in ipr.route('get', dst=dst)[0]['attrs']:
9999
if k == "RTA_PREFSRC":
100100
ret_val = v

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
'boto3',
6363
'pysftp',
6464
'netifaces',
65-
'pyroute2',
65+
'pyroute2.core',
6666
'redis',
6767
'requests',
6868
'elasticsearch>=7.0.0,<8.0.0,!=7.0.3', # 7.0.3 is excluded due to an error

0 commit comments

Comments
 (0)