Commit d1f3c6bb by Őry Máté

storage: add default datastore to Disk.create

parent 6014f0de
......@@ -293,7 +293,8 @@ class Disk(AclBase, TimeStampedModel):
@classmethod
def create(cls, **params):
disk = cls(filename=str(uuid.uuid4()), **params)
datastore = params.pop('datastore', DataStore.objects.get())
disk = cls(filename=str(uuid.uuid4()), datastore=datastore, **params)
disk.save()
return disk
......
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