@@ -809,9 +809,7 @@ def filter_specific_objects(results, query, object_type):
809809 filtered_results = filter_results (results , query )
810810 if len (filtered_results ) > 1 :
811811 raise errors .ScaleComputingError (
812- "{0} isn't uniquely identifyed by {1} in the VM." .format (
813- object_type , query
814- )
812+ f"{ object_type } isn't uniquely identifyed by { query } in the VM."
815813 )
816814 return filtered_results [0 ] if filtered_results else None
817815
@@ -843,7 +841,7 @@ def update_boot_device_order(module, rest_client, vm, boot_order):
843841 # uuid is vm's uuid. boot_order is the desired order we want to set to boot devices
844842 vm .do_shutdown_steps (module , rest_client )
845843 task_tag = rest_client .update_record (
846- "{0}/{1}" . format ( "/ rest/v1/VirDomain" , vm .uuid ) ,
844+ f"/ rest/v1/VirDomain/ { vm .uuid } " ,
847845 dict (bootDevices = boot_order ),
848846 module .check_mode ,
849847 )
@@ -1297,7 +1295,7 @@ def set_vm_params(cls, module, rest_client, vm, param_subset: List[str]):
12971295
12981296 if changed :
12991297 payload = ManageVMParams ._build_payload (module , rest_client )
1300- endpoint = "{0}/{1}" . format ( "/ rest/v1/VirDomain" , vm .uuid )
1298+ endpoint = f"/ rest/v1/VirDomain/ { vm .uuid } "
13011299 task_tag = rest_client .update_record (endpoint , payload , module .check_mode )
13021300 TaskTag .wait_task (rest_client , task_tag )
13031301
@@ -1396,7 +1394,7 @@ def iso_image_management(module, rest_client, iso, uuid, attach):
13961394 # If false, it means you're detaching an image.
13971395 payload = iso .attach_iso_payload () if attach else iso .detach_iso_payload ()
13981396 task_tag = rest_client .update_record (
1399- "{0}/{1}" . format ( "/ rest/v1/VirDomainBlockDevice" , uuid ) ,
1397+ f"/ rest/v1/VirDomainBlockDevice/ { uuid } " ,
14001398 payload ,
14011399 module .check_mode ,
14021400 )
@@ -1412,7 +1410,7 @@ def _update_block_device(
14121410 if existing_disk .needs_reboot ("update" , desired_disk ):
14131411 vm .do_shutdown_steps (module , rest_client )
14141412 task_tag = rest_client .update_record (
1415- "{0}/{1}" . format ( "/ rest/v1/VirDomainBlockDevice" , existing_disk .uuid ) ,
1413+ f"/ rest/v1/VirDomainBlockDevice/ { existing_disk .uuid } " ,
14161414 payload ,
14171415 module .check_mode ,
14181416 )
@@ -1446,9 +1444,7 @@ def _delete_not_used_disks(cls, module, rest_client, vm, changed, disk_key):
14461444 if existing_disk .needs_reboot ("delete" ):
14471445 vm .do_shutdown_steps (module , rest_client )
14481446 task_tag = rest_client .delete_record (
1449- "{0}/{1}" .format (
1450- "/rest/v1/VirDomainBlockDevice" , existing_disk .uuid
1451- ),
1447+ f"/rest/v1/VirDomainBlockDevice/{ existing_disk .uuid } " ,
14521448 module .check_mode ,
14531449 )
14541450 try :
@@ -1468,9 +1464,7 @@ def _delete_not_used_disks(cls, module, rest_client, vm, changed, disk_key):
14681464 # shutdown and retry remove
14691465 vm .do_shutdown_steps (module , rest_client )
14701466 task_tag = rest_client .delete_record (
1471- "{0}/{1}" .format (
1472- "/rest/v1/VirDomainBlockDevice" , existing_disk .uuid
1473- ),
1467+ f"/rest/v1/VirDomainBlockDevice/{ existing_disk .uuid } " ,
14741468 module .check_mode ,
14751469 )
14761470 TaskTag .wait_task (rest_client , task_tag , module .check_mode )
@@ -1507,7 +1501,7 @@ def _force_remove_all_disks(module, rest_client, vm, disks_before):
15071501 # Delete all disks
15081502 for existing_disk in vm .disks :
15091503 task_tag = rest_client .delete_record (
1510- "{0}/{1}" . format ( "/ rest/v1/VirDomainBlockDevice" , existing_disk .uuid ) ,
1504+ f"/ rest/v1/VirDomainBlockDevice/ { existing_disk .uuid } " ,
15111505 module .check_mode ,
15121506 )
15131507 TaskTag .wait_task (rest_client , task_tag , module .check_mode )
0 commit comments