Set configuration to empty string if not available

This commit is contained in:
PCoder 2019-04-09 09:12:09 +02:00
parent 5b7d1301cf
commit a8caa035c0

View file

@ -47,7 +47,8 @@ def get_or_create_vm_detail(user, manager, vm_id):
vm_detail_obj = VMDetail.objects.create( vm_detail_obj = VMDetail.objects.create(
user=user, vm_id=vm_id, disk_size=vm['disk_size'], user=user, vm_id=vm_id, disk_size=vm['disk_size'],
cores=vm['cores'], memory=vm['memory'], cores=vm['cores'], memory=vm['memory'],
configuration=vm['configuration'], ipv4=vm['ipv4'], configuration="" if vm['configuration'] is None else vm['configuration'],
ipv4=vm['ipv4'],
ipv6=vm['ipv6'] ipv6=vm['ipv6']
) )
return vm_detail_obj return vm_detail_obj