1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

call function with parameter names

This commit is contained in:
catborise 2022-09-05 15:35:51 +03:00
parent 5425519408
commit 31c575e852

View file

@ -199,24 +199,24 @@ class CreateInstanceViewSet(viewsets.ViewSet):
firmware["secure"] = "yes" firmware["secure"] = "yes"
ret = conn.create_instance( ret = conn.create_instance(
serializer.validated_data['name'], name=serializer.validated_data['name'],
serializer.validated_data['memory'], memory=serializer.validated_data['memory'],
serializer.validated_data['vcpu'], vcpu=serializer.validated_data['vcpu'],
serializer.validated_data['vcpu_mode'], vcpu_mode=serializer.validated_data['vcpu_mode'],
util.randomUUID(), uuid=util.randomUUID(),
arch, arch=arch,
machine, machine=machine,
firmware, firmware=firmware,
volume_list, volumes=volume_list,
serializer.validated_data['networks'], networks=serializer.validated_data['networks'],
serializer.validated_data['nwfilter'], nwfilter=serializer.validated_data['nwfilter'],
serializer.validated_data['graphics'], graphics=serializer.validated_data['graphics'],
serializer.validated_data['virtio'], virtio=serializer.validated_data['virtio'],
serializer.validated_data['listener_addr'], listener_addr=serializer.validated_data['listener_addr'],
serializer.validated_data['video'], video=serializer.validated_data['video'],
serializer.validated_data['console_pass'], console_pass=serializer.validated_data['console_pass'],
serializer.validated_data['mac'], mac=serializer.validated_data['mac'],
serializer.validated_data['qemu_ga'], qemu_ga=serializer.validated_data['qemu_ga'],
) )
msg = f"Instance {serializer.validated_data['name']} is created" msg = f"Instance {serializer.validated_data['name']} is created"
return Response({'status': msg }) return Response({'status': msg })