Skip to content

Commit 247563a

Browse files
authored
Merge pull request #790 from netenglabs/minor-fixes-0.19.1
Minor fixes 0.19.1
2 parents 163c14e + 19c659f commit 247563a

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

suzieq/engines/pandas/path.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ def _init_dfs(self, ns, source, dest):
119119

120120
if ':' in source:
121121
self._src_df = self._if_df[self._if_df.ip6AddressList.astype(str)
122-
.str.contains(source + "/")]
122+
.str.startswith(source + "/")]
123123
else:
124124
self._src_df = self._if_df[self._if_df.ipAddressList.astype(str)
125-
.str.contains(source + "/")]
125+
.str.startswith(source + "/")]
126126

127127
if self._src_df.empty:
128128
# TODO: No host with this src addr. Is addr a local ARP entry?
@@ -147,10 +147,10 @@ def _init_dfs(self, ns, source, dest):
147147

148148
if ':' in dest:
149149
self._dest_df = self._if_df[self._if_df.ip6AddressList.astype(str)
150-
.str.contains(dest + "/")]
150+
.str.startswith(dest + "/")]
151151
else:
152152
self._dest_df = self._if_df[self._if_df.ipAddressList.astype(str)
153-
.str.contains(dest + "/")]
153+
.str.startswith(dest + "/")]
154154

155155
if self._dest_df.empty:
156156
# Check if addr is in any switch's local ARP
@@ -929,10 +929,10 @@ def get(self, **kwargs) -> pd.DataFrame:
929929
if not nhdf.empty:
930930
if srcvers == 4:
931931
nhdf = nhdf.query(
932-
f'ipAddressList.str.contains("{ndst}")')
932+
f'ipAddressList.str.startswith("{ndst}/")')
933933
else:
934934
nhdf = nhdf.query(
935-
f'ip6AddressList.str.contains("{ndst}")')
935+
f'ip6AddressList.str.startswith("{ndst}/")')
936936
if not nhdf.empty:
937937
ifmac = nhdf.macaddr.unique().tolist()
938938
if (not macaddr) or (macaddr in ifmac):

suzieq/engines/pandas/topology.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
class TopologyObj(SqPandasEngine):
2424
'''Backend class to operate on virtual table, topology, with pandas'''
2525

26+
def __init__(self, baseobj):
27+
super().__init__(baseobj)
28+
self.lsdb = pd.DataFrame()
29+
self._a_df = pd.DataFrame()
30+
self._ip_table = pd.DataFrame()
31+
self.nses = []
32+
2633
@staticmethod
2734
def table_name():
2835
'''Table name'''
@@ -86,9 +93,6 @@ class Services:
8693
self._init_dfs(self._namespaces)
8794
if self._if_df.empty:
8895
return pd.DataFrame({'error': ['No interfaces data found']})
89-
self.lsdb = pd.DataFrame()
90-
self._a_df = pd.DataFrame()
91-
self._ip_table = pd.DataFrame()
9296

9397
fields = self.schema.get_display_fields(columns)
9498

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
description: Testing some common errors independent of NOS
2+
tests:
3+
- command: topology summarize --namespace=whatever --format=json
4+
data-directory: tests/data/parquet/
5+
marks: topology summarize
6+
output: '{}'

0 commit comments

Comments
 (0)