Improve the conditional so it will always work
This commit is contained in:
parent
0468eeb531
commit
5b5b7d2276
|
@ -952,7 +952,7 @@ def resize_volume(zk_conn, pool, name, size):
|
||||||
active_node = vm_info['node']
|
active_node = vm_info['node']
|
||||||
volume_id = disk['dev']
|
volume_id = disk['dev']
|
||||||
# 2b. Perform a live resize in libvirt if the VM is running
|
# 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
|
import libvirt
|
||||||
# Run the libvirt command against the target host
|
# Run the libvirt command against the target host
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue