Merge "libvirt: Fix nova-libvirt-cleanup command"
This commit is contained in:
commit
0226172ef7
@ -14,12 +14,14 @@
|
|||||||
register: container_facts
|
register: container_facts
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
# NOTE(mgoddard): pgrep exit status 1 means no match.
|
||||||
- name: Check if there are any running VMs
|
- name: Check if there are any running VMs
|
||||||
become: true
|
become: true
|
||||||
shell:
|
shell:
|
||||||
cmd: >
|
cmd: >
|
||||||
set -o pipefail &&
|
set -o pipefail &&
|
||||||
pgrep -l qemu | awk '!/qemu-ga/ && !/qemu-img/ {print $1}'
|
{ pgrep -l qemu || test $? = 1; } | awk '!/qemu-ga/ && !/qemu-img/ {print $1}'
|
||||||
|
executable: /bin/bash
|
||||||
register: running_vms
|
register: running_vms
|
||||||
|
|
||||||
- name: Fail if there are any running VMs
|
- name: Fail if there are any running VMs
|
||||||
|
Loading…
Reference in New Issue
Block a user