Commit e7ed8921 by Őry Máté

one: fix show.html if no firewall_host

parent 7e6a19f1
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
</table> </table>
</div> </div>
</div> </div>
{% if i.firewall_host %}
<div class="contentblock" id="ports"> <div class="contentblock" id="ports">
<h2>{% trans "Port administration" %}</h2> <h2>{% trans "Port administration" %}</h2>
<div class="content"> <div class="content">
...@@ -158,6 +159,7 @@ ...@@ -158,6 +159,7 @@
</form> </form>
</div> </div>
</div> </div>
{% endif %}
</div> </div>
<div class="boxes"> <div class="boxes">
<div class="contentblock" id="vm-list"> <div class="contentblock" id="vm-list">
......
...@@ -168,6 +168,10 @@ def vm_show(request, iid): ...@@ -168,6 +168,10 @@ def vm_show(request, iid):
inst.update_state() inst.update_state()
if inst.template.state == "SAVING": if inst.template.state == "SAVING":
inst.check_if_is_save_as_done() inst.check_if_is_save_as_done()
try:
ports = inst.firewall_host.list_ports()
except:
ports = None
return render_to_response("show.html", RequestContext(request,{ return render_to_response("show.html", RequestContext(request,{
'uri': inst.get_connect_uri(), 'uri': inst.get_connect_uri(),
'state': inst.state, 'state': inst.state,
...@@ -177,7 +181,7 @@ def vm_show(request, iid): ...@@ -177,7 +181,7 @@ def vm_show(request, iid):
'instances': _list_instances(request), 'instances': _list_instances(request),
'i': inst, 'i': inst,
'booting' : not inst.active_since, 'booting' : not inst.active_since,
'ports': inst.firewall_host.list_ports() 'ports': ports,
})) }))
@require_safe @require_safe
......
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 sign in to comment