Skip to content

Commit

Permalink
Merge pull request netenglabs#933 from rickstardust/ospf_fix
Browse files Browse the repository at this point in the history
Fixed issue ospf gui (Issue netenglabs#929)
  • Loading branch information
ddutt authored Apr 11, 2024
2 parents 4943848 + fe184e3 commit 4aa0898
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions suzieq/engines/pandas/ospf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def _get_combined_df(self, **kwargs):

ifschema = SchemaForTable('ospfIf', schema=self.all_schemas)
nbrschema = SchemaForTable('ospfNbr', schema=self.all_schemas)
ospfschema = SchemaForTable('ospf', schema=self.all_schemas)

if columns not in [['default'], ['*']]:
ifkeys = ifschema.key_fields()
Expand Down Expand Up @@ -102,6 +103,13 @@ def _get_combined_df(self, **kwargs):
nbr_df = self._get_table_sqobj('ospfNbr') \
.get(columns=nbrcols, **kwargs)
if nbr_df.empty:
ospf_clmns = ospfschema.get_display_fields(['default'])
missing_cols = set(ospf_clmns) - set(df.columns)
for col in missing_cols:
df[col] = np.nan
df = df.fillna({'peerIP': '-', 'peerHostname': '',
'lastChangeTime': 0, 'numChanges': 0,
'ifState': '', 'adjState': ''})
return df

merge_cols = [x for x in ['namespace', 'hostname', 'ifname']
Expand Down

0 comments on commit 4aa0898

Please sign in to comment.