File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff 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' ]
You can’t perform that action at this time.
0 commit comments