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):
def post(self, request, format=None):
data = request.data
template = InstanceTemplate(
name="test1", description="adsasdasd",
remote_ID="da51253f-867c-472d-8ce0-81e7b7126d60")
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()
template = InstanceTemplate.objects.get(pk=data["template"])
flavor = Flavor.objects.get(pk=data["flavor"])
lease = lease.objects.get(pk=data["lease"])
newInstance = Instance.create_instance_from_template(
params={"name": data["name"],
"description": data["description"],
"access_method": "ssh",
"access_method": data["access"],
"system": data["system"],
"deleted": False,
"password": "asd",
},
lease=lease,
networks=[{"uuid": "c03d0d4b-413e-4cc6-9ebe-c0b5ca0dac3a"}],
networks=template.networks,
template=template,
flavor=flavor,
owner=User.objects.get(pk=1),
disks="asdasd"
owner=request.user,
disks=template.disks
)
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