elastic/curator

'indices' missing in stats dict

ttych opened this issue · 3 comments

ttych commented

Hi,

for index in stats['indices']:

In this code, in some situations the indices is not present in the stats dict,

leading to errors like :
Failed to complete action: delete_indices. <class 'KeyError'>: 'indices'

Could it be possible to protect this execution by adding a chunk of code like :

if 'indices' not in stats:
    return

Thanks,

Regards,

Under what conditions is stats not showing indices? I'm curious what conditions are showing no indices in stats. I can't test for it and properly code around it if I can't create/simulate a situation where there are no index stats.

I ask simply because the absence of stats will cause a different exception in other execution blocks where the stats are expected. I can't simply nope out here and expect the rest of Curator to function as expected. I need to know what's happening so I can fully code around it.

It's either that, or I have to raise exceptions here and everywhere stats are expected but not found.