prevent keyError when double_check_capsul_address returns None
This commit is contained in:
parent
ba0b29462c
commit
fd5d23cf22
@ -63,6 +63,9 @@ def index():
|
|||||||
if result is not None:
|
if result is not None:
|
||||||
vm["ipv4"] = result.ipv4
|
vm["ipv4"] = result.ipv4
|
||||||
vm["state"] = result.state
|
vm["state"] = result.state
|
||||||
|
else:
|
||||||
|
vm["state"] = "unknown"
|
||||||
|
|
||||||
|
|
||||||
vms = list(map(
|
vms = list(map(
|
||||||
lambda x: dict(
|
lambda x: dict(
|
||||||
|
@ -38,6 +38,8 @@
|
|||||||
<td class="capsul-status waiting-pulse">•</td>
|
<td class="capsul-status waiting-pulse">•</td>
|
||||||
{% elif vm['state'] == 'crashed' or vm['state'] == 'blocked' or vm['state'] == 'stopped' %}
|
{% elif vm['state'] == 'crashed' or vm['state'] == 'blocked' or vm['state'] == 'stopped' %}
|
||||||
<td class="capsul-status red">•</td>
|
<td class="capsul-status red">•</td>
|
||||||
|
{% elif vm['state'] == 'unknown' %}
|
||||||
|
<td class="capsul-status">?</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td class="capsul-status green">•</td>
|
<td class="capsul-status green">•</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
Loading…
Reference in New Issue
Block a user