Improve the conditional so it will always work

This commit is contained in:
Joshua Boniface 2020-08-11 23:08:40 -04:00
parent 0468eeb531
commit 5b5b7d2276
1 changed files with 1 additions and 1 deletions

View File

@ -952,7 +952,7 @@ def resize_volume(zk_conn, pool, name, size):
active_node = vm_info['node']
volume_id = disk['dev']
# 2b. Perform a live resize in libvirt if the VM is running
if vm_info['state'] == 'start' and active_node is not None:
if active_node is not None and vm_info.get('state', '') == 'start':
import libvirt
# Run the libvirt command against the target host
try: