From e3f4de214cad6c75f0df33259f1dfce96482f877 Mon Sep 17 00:00:00 2001 From: j3s Date: Wed, 20 May 2020 18:37:53 -0500 Subject: [PATCH] Strip out deleted VMs before passing them to shell scripts --- capsulflask/console.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/capsulflask/console.py b/capsulflask/console.py index 16e0d0e..94eeaa4 100644 --- a/capsulflask/console.py +++ b/capsulflask/console.py @@ -44,6 +44,7 @@ def double_check_capsul_address(id, ipv4): @account_required def index(): vms = get_vms() + vms = list(filter(lambda x: not x['deleted'], vms)) created = request.args.get('created') # this is here to prevent xss @@ -63,8 +64,7 @@ def index(): ipv4_status=("ok" if x['ipv4'] else "waiting-pulse"), os=x['os'], created=x['created'].strftime("%b %d %Y") - ), - list(filter(lambda x: not x['deleted'], vms)) + ), vms )) return render_template("capsuls.html", vms=vms, has_vms=len(vms) > 0, created=created)