renamed sdd_size -> ssd_size

This commit is contained in:
Arvind Tiwari 2018-02-23 20:05:24 +05:30
parent d9ee956a29
commit ef0b2ea34e

View file

@ -50,7 +50,7 @@ class VirtualMachineSerializer(serializers.Serializer):
disk_size = serializers.SerializerMethodField() disk_size = serializers.SerializerMethodField()
hdd_size = serializers.SerializerMethodField() hdd_size = serializers.SerializerMethodField()
sdd_size = serializers.SerializerMethodField() ssd_size = serializers.SerializerMethodField()
ipv4 = serializers.SerializerMethodField() ipv4 = serializers.SerializerMethodField()
ipv6 = serializers.SerializerMethodField() ipv6 = serializers.SerializerMethodField()
vm_id = serializers.IntegerField(read_only=True, source='id') vm_id = serializers.IntegerField(read_only=True, source='id')
@ -90,7 +90,9 @@ class VirtualMachineSerializer(serializers.Serializer):
ssh_key=ssh_key, ssh_key=ssh_key,
specs=specs) specs=specs)
except OpenNebulaException as err: except OpenNebulaException as err:
raise serializers.ValidationError("OpenNebulaException occured. {0}".format(err)) raise serializers.ValidationError(
"OpenNebulaException occured. {0}".format(err)
)
return manager.get_vm(opennebula_id) return manager.get_vm(opennebula_id)
@ -165,7 +167,9 @@ class VirtualMachineSerializer(serializers.Serializer):
class VMTemplateSerializer(serializers.Serializer): class VMTemplateSerializer(serializers.Serializer):
"""Serializer to map the VMTemplate instance into JSON format.""" """Serializer to map the VMTemplate instance into JSON format."""
id = serializers.IntegerField(read_only=True, source='opennebula_vm_template_id') id = serializers.IntegerField(
read_only=True, source='opennebula_vm_template_id'
)
name = serializers.CharField(read_only=True) name = serializers.CharField(read_only=True)