Merge remote-tracking branch 'ungleich/master' into task/3713/clean_up_css

This commit is contained in:
Arvind Tiwari 2018-02-23 20:09:30 +05:30
commit 4376ab4904

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)