Commit d1d3fba5 by Chif Gergő

Remove test data from the view

parent f99a7459
Pipeline #765 failed with stages
in 55 seconds
...@@ -19,30 +19,22 @@ class InstanceList(APIView): ...@@ -19,30 +19,22 @@ class InstanceList(APIView):
def post(self, request, format=None): def post(self, request, format=None):
data = request.data data = request.data
template = InstanceTemplate( template = InstanceTemplate.objects.get(pk=data["template"])
name="test1", description="adsasdasd", flavor = Flavor.objects.get(pk=data["flavor"])
remote_ID="da51253f-867c-472d-8ce0-81e7b7126d60") lease = lease.objects.get(pk=data["lease"])
flavor = Flavor(name="asd", description="asd", remote_id="1")
flavor.save()
lease = Lease(name="test_lease", description="test",
suspend_interval_in_sec=100,
delete_interval_in_sec=100)
lease.save()
newInstance = Instance.create_instance_from_template( newInstance = Instance.create_instance_from_template(
params={"name": data["name"], params={"name": data["name"],
"description": data["description"], "description": data["description"],
"access_method": "ssh", "access_method": data["access"],
"system": data["system"], "system": data["system"],
"deleted": False,
"password": "asd",
}, },
lease=lease, lease=lease,
networks=[{"uuid": "c03d0d4b-413e-4cc6-9ebe-c0b5ca0dac3a"}], networks=template.networks,
template=template, template=template,
flavor=flavor, flavor=flavor,
owner=User.objects.get(pk=1), owner=request.user,
disks="asdasd" disks=template.disks
) )
return Response(newInstance.pk) return Response(newInstance.pk)
......
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