Storage Fixes
Cleaning up storage codebase
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
-
274 274 if instance: 275 275 instance.disks.add(disk) 276 276 return disk 277 278 @classmethod 279 def create_from_url_async(cls, url, instance=None, params=None, user=None): 280 """Create disk object and download data from url asynchronusly. 281 282 :param url: image url to download. 283 :type url: url -
-
264 """Create empty Disk object asynchronusly. 265 266 :param instance: instnace object to connect disk 267 :type instane: vm.models.Instance 268 :param params: disk custom parameters 269 :type params: dict 270 :param user: owner of the disk 271 :type user: django.contrib.auth.User 272 """ 273 return local_tasks.create_empty.apply_async( 274 args=[instance, params, user], queue="localhost.man") 275 276 @classmethod 277 def create_empty(cls, instance=None, params=None, 278 user=None, task_uuid=None): 279 """Create empty Disk object. -
321 @classmethod 322 def create_from_url(cls, url, instance=None, params=None, user=None, 323 task_uuid=None, abortable_task=None): 324 """Create disk object and download data from url synchronusly. 325 326 :param url: image url to download. 327 :type url: url 328 :param instance: instnace object to connect disk 329 :type instane: vm.models.Instance 330 :param params: disk custom parameters 331 :type params: dict 332 :param user: owner of the disk 333 :type user: django.contrib.auth.User 334 335 :return: Task 336 :rtype: AsyncResult -
16 def setUp(self): 17 self.ds = DataStore.objects.create(path="/datastore", 18 hostname="devenv", name="default") 19 20 def _disk(self, destroyed=None, base=None): 21 self.n += 1 22 n = "d%d" % self.n 23 return Disk.objects.create(name=n, filename=n, base=base, size=1, 24 destroyed=destroyed, datastore=self.ds) 25 26 def test_deletable_not_destroyed(self): 27 d = self._disk() 28 assert not d.is_deletable() 29 30 def test_deletable_newly_destroyed(self): 31 d = self._disk() -
-