netenglabs / suzieq

Using network observability to operate and design healthier networks
https://www.stardustsystems.net/
Apache License 2.0
789 stars 104 forks source link

cli, if there is no data in a table and do a table show, get a FileNotFoundError #16

Closed jopietsch closed 4 years ago

jopietsch commented 4 years ago

In [33]: ospfCmd.ospfCmd().show()

FileNotFoundError Traceback (most recent call last)

in ----> 1 ospfCmd.ospfCmd().show() ~/suzieq/suzieq/cli/sqcmds/ospfCmd.py in show(self, ifname, vrf, state, type) 70 columns=self.columns, 71 datacenter=self.datacenter, ---> 72 type=type, 73 ) 74 self.ctxt.exec_time = "{:5.4f}s".format(time.time() - now) ~/suzieq/suzieq/sqobjects/ospf.py in get(self, **kwargs) 32 raise AttributeError('No analysis engine specified') 33 ---> 34 return self.engine_obj.get(**kwargs) 35 36 def summarize(self, **kwargs): ~/suzieq/suzieq/engines/pandas/ospf.py in get(self, **kwargs) 30 del kwargs["type"] 31 ---> 32 df = self.get_valid_df(table, sort_fields, **kwargs) 33 return df 34 ~/suzieq/suzieq/engines/pandas/engineobj.py in get_valid_df(self, table, sort_fields, **kwargs) 124 end_time=self.iobj.end_time, 125 sort_fields=sort_fields, --> 126 **kwargs 127 ) 128 ~/suzieq/suzieq/engines/pandas/engine.py in get_table_df(self, cfg, schemas, **kwargs) 59 folder += "/datacenter={}/".format(v) 60 ---> 61 fcnt = self.get_filecnt(folder) 62 63 use_get_files = ( ~/suzieq/suzieq/engines/pandas/engine.py in get_filecnt(self, path) 176 def get_filecnt(self, path="."): 177 total = 0 --> 178 for entry in os.scandir(path): 179 if entry.is_file(): 180 total += 1 FileNotFoundError: [Errno 2] No such file or directory: './tests/data/basic_dual_bgp/parquet-out/ospfNbr'
ddutt commented 4 years ago

Dup of fix for #15

jopietsch commented 4 years ago

this isn't a dup. I don't have OSPF or EVPN data in the test data. so no matter the command or filter it gives FileNotFoundError it also still fails

jopietsch commented 4 years ago

fixed. returns empty dataframe