Commit 94c846e5 authored by Sergios Aftsidis's avatar Sergios Aftsidis

Catch exception and continue in graph datasources iteration

parent 82335374
...@@ -101,8 +101,12 @@ def graph_for_each_interface(datasources, start='-1d', end='-100'): ...@@ -101,8 +101,12 @@ def graph_for_each_interface(datasources, start='-1d', end='-100'):
dss = datasources[i * 2:i * 2 + 2] dss = datasources[i * 2:i * 2 + 2]
if dss: if dss:
ifce = Ifce.objects.get(pk=dss[0].object_id) ifce = Ifce.objects.get(pk=dss[0].object_id)
png = dss[0].graph_set.filter(type='traffic')[0].get_draw_url() # import pdb; pdb.set_trace()
mon = dss[0].graph_set.filter(type='traffic')[0].get_absolute_url() try:
png = dss[0].graph_set.filter(type='traffic')[0].get_draw_url()
mon = dss[0].graph_set.filter(type='traffic')[0].get_absolute_url()
except IndexError:
continue
if start and end: if start and end:
png += '%s,%s/' % (start, end) png += '%s,%s/' % (start, end)
response.update({ response.update({
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment