Skip to content

Commit 4aa0898

Browse files
authored
Merge pull request #933 from rickstardust/ospf_fix
Fixed issue ospf gui (Issue #929)
2 parents 4943848 + fe184e3 commit 4aa0898

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

suzieq/engines/pandas/ospf.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def _get_combined_df(self, **kwargs):
3939

4040
ifschema = SchemaForTable('ospfIf', schema=self.all_schemas)
4141
nbrschema = SchemaForTable('ospfNbr', schema=self.all_schemas)
42+
ospfschema = SchemaForTable('ospf', schema=self.all_schemas)
4243

4344
if columns not in [['default'], ['*']]:
4445
ifkeys = ifschema.key_fields()
@@ -102,6 +103,13 @@ def _get_combined_df(self, **kwargs):
102103
nbr_df = self._get_table_sqobj('ospfNbr') \
103104
.get(columns=nbrcols, **kwargs)
104105
if nbr_df.empty:
106+
ospf_clmns = ospfschema.get_display_fields(['default'])
107+
missing_cols = set(ospf_clmns) - set(df.columns)
108+
for col in missing_cols:
109+
df[col] = np.nan
110+
df = df.fillna({'peerIP': '-', 'peerHostname': '',
111+
'lastChangeTime': 0, 'numChanges': 0,
112+
'ifState': '', 'adjState': ''})
105113
return df
106114

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

0 commit comments

Comments
 (0)