From 2dbb8609c89c9508aaa8af687497429fadb55083 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Wed, 29 Mar 2017 20:56:21 -0500 Subject: [PATCH] Added constraints to qemu save dir check and move This change adds a constraint to the "/var/lib/libvirt/qemu/save" directory state check and list commands so that should the dir not exist and not be created by the libvirt startup process the role can carry on with the subsequent linking of "/var/lib/libvirt/qemu/save" to "{{ nova_libvirt_save_path }}". Change-Id: I5e4e2d6f48845f1edc13d3b548df9d0d40fd68d0 Signed-off-by: Kevin Carter --- tasks/nova_compute_kvm_install.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/nova_compute_kvm_install.yml b/tasks/nova_compute_kvm_install.yml index 67426cda..9cbeb325 100644 --- a/tasks/nova_compute_kvm_install.yml +++ b/tasks/nova_compute_kvm_install.yml @@ -24,12 +24,16 @@ until: _qemu_save_dir.stat.exists | bool retries: 5 delay: 10 + failed_when: false register: _qemu_save_dir - name: Check if the qemu save directory is empty command: 'ls -1A /var/lib/libvirt/qemu/save' changed_when: false register: _qemu_save_dir_contents + when: + - _qemu_save_dir.stat.isdir is defined + - _qemu_save_dir.stat.isdir | bool - name: Move the existing save directory to nova_libvirt_save_path command: "mv /var/lib/libvirt/qemu/save {{ nova_libvirt_save_path }}"