Commit 6277a2eb by Karsa Zoltán István

update

parent 63351c3f
...@@ -159,9 +159,8 @@ class CreateDiskSerializer(serializers.Serializer): ...@@ -159,9 +159,8 @@ class CreateDiskSerializer(serializers.Serializer):
size = serializers.CharField(max_length=50) size = serializers.CharField(max_length=50)
name = serializers.CharField(max_length=100) name = serializers.CharField(max_length=100)
datastore = serializers.CharField(max_length=40, required=False, allow_blank=True, default=None) datastore = serializers.CharField(max_length=40, required=False, allow_blank=True, default=None)
cache_size = serializers.IntegerField(required=False, allow_blank=True, default=1024) cache_size = serializers.IntegerField(initial=1024)
cluster_size = serializers.IntegerField(required=False, allow_blank=True, default=64) cluster_size = serializers.IntegerField(initial=64)
class ResizeDiskSerializer(serializers.Serializer): class ResizeDiskSerializer(serializers.Serializer):
size = serializers.CharField(max_length=50) size = serializers.CharField(max_length=50)
......
...@@ -138,10 +138,10 @@ class CreatePersistentDiskREST(APIView): ...@@ -138,10 +138,10 @@ class CreatePersistentDiskREST(APIView):
datastore = data['datastore'] datastore = data['datastore']
cache_size = 1024 cache_size = 1024
if 'cache_size' in data: if 'cache_size' in data:
cache_size = data['cache_size'] cache_size = int(data['cache_size'])
cluster_size = 64 cluster_size = 64
if 'cluster_size' in data: if 'cluster_size' in data:
cluster_size = data['cluster_size'] cluster_size = int(data['cluster_size'])
disk = Disk.create(size=disk_size, name=disk_name, type="qcow2-norm", datastore=datastore, cache_size=cache_size, cluster_size=cluster_size) disk = Disk.create(size=disk_size, name=disk_name, type="qcow2-norm", datastore=datastore, cache_size=cache_size, cluster_size=cluster_size)
disk.full_clean() disk.full_clean()
disk.dev_num = 'f' disk.dev_num = 'f'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment