@@ -1108,9 +1108,9 @@ def _delete_not_used_disks(cls, module, rest_client, vm, changed, disk_key):
11081108 except errors .TaskTagError as ex :
11091109 # Delete failed, maybe because VM was running and disk was in use.
11101110 # If VM is running, shutdown VM and retry delete.
1111- if ex .task_tag_state != "ERROR" :
1111+ if ex .task_status_state != "ERROR" :
11121112 raise
1113- if not cls ._disk_remove_failed_because_vm_running (ex .task_tag ):
1113+ if not cls ._disk_remove_failed_because_vm_running (ex .task_status ):
11141114 raise
11151115 vm_fresh_data = rest_client .get_record (
11161116 f"/rest/v1/VirDomain/{ vm .uuid } " , must_exist = True
@@ -1130,19 +1130,19 @@ def _delete_not_used_disks(cls, module, rest_client, vm, changed, disk_key):
11301130 return changed
11311131
11321132 @staticmethod
1133- def _disk_remove_failed_because_vm_running (task_tag : Dict ):
1133+ def _disk_remove_failed_because_vm_running (task_status : Dict ):
11341134 # Look at task_tag dict returned by HyperCore to decide if disk remove failed
11351135 # because VM is running, and VM shutdown will allow us to remove the disk.
11361136 # What we search for in formattedMessage is HyperCore version dependent:
11371137 # 9.2.17 - "Unable to delete block device from VM '%@': Still in use"
11381138 # 9.1.14 - "Virt Exception, code: 84, domain 10: Operation not supported: This type of disk cannot be hot unplugged"
11391139
11401140 if (
1141- task_tag ["formattedMessage" ]
1141+ task_status ["formattedMessage" ]
11421142 == "Unable to delete block device from VM '%@': Still in use"
11431143 ):
11441144 return True
1145- if task_tag ["formattedMessage" ].endswith (
1145+ if task_status ["formattedMessage" ].endswith (
11461146 "Operation not supported: This type of disk cannot be hot unplugged"
11471147 ):
11481148 return True
0 commit comments