From 9004e2bb6e08743de6641a15b591a821cafe5c6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20G=C3=A9rczei?= Date: Tue, 26 Apr 2016 09:24:22 +0200 Subject: [PATCH] simplified priority evaluation pipeline --- svc-guesthandler | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/svc-guesthandler b/svc-guesthandler index b68ba7d..03a14e8 100644 --- a/svc-guesthandler +++ b/svc-guesthandler @@ -20,7 +20,7 @@ function log { case $1 in start) # determine the order of VMs by boot priority - ORDER=$(vmadm lookup -j -o uuid,tags | json -c 'this.tags.priority > 0' -a uuid tags.priority | sort -nk2 | cut -d " " -f1) + ORDER=$(vmadm list -Ho uuid,tags.priority -s tags.priority tags.priority='~[^0]' | cut -d " " -f1) log start-up order determined as: $ORDER # start guests @@ -42,7 +42,7 @@ case $1 in stop) # determine the order of VMs by reverse boot priority - ORDER=$(vmadm lookup -j -o uuid,tags state=running | json -a uuid tags.priority | sort -rnk2 | cut -d " " -f1) + ORDER=$(vmadm list -Ho uuid,tags.priority -s -tags.priority state=running | cut -d " " -f1) log shutdown order determined as: $ORDER # stop guests