Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Merged
Merge request !11 opened Feb 26, 2014 by Guba Sándor@gubasandor 
  • Report abuse
Report abuse

Storage Fixes

Cleaning up storage codebase

  • Discussion 14
  • Commits 17
  • Changes
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Őry Máté
    @orymate started a discussion on commit 2c82e657 Feb 26, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/models.py
    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
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      string!

      string!
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      fixed

      fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 26, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/models.py
    100 107  
    101 108 @property
    102 109 def path(self):
    110 """Get the path where the files are stored."""
    103 111 return self.datastore.path + '/' + self.filename
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      os.path.join?

      `os.path.join`?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      fixed 5f8dcc9e

      fixed 5f8dcc9ec
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on an old version of the diff Feb 26, 2014
    Last updated by Guba Sándor Feb 28, 2014
    circle/storage/models.py
    137
    138 Checks if all children and the disk itself is destroyed.
    139 """
    140
    141 yesterday = timezone.now() - timedelta(days=1)
    142 return (self.destroyed is not None
    143 and self.destroyed < yesterday) and not self.has_active_child()
    144
    145 def has_active_child(self):
    146 """Returns if disk has children that are not destroyed.
    147 """
    148
    149 return any((not i.is_deletable() for i in self.derivatives.all()))
    150
    125 151 def is_in_use(self):
    152 """Returns True if disc is attached to an active VM else False"""
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      Why is this implementation correct?

      Why is this implementation correct?
    • Guba Sándor @gubasandor commented Feb 28, 2014
      Owner

      Only stopped instances have consistent disk. Running and Suspended, etc machines are not good for saving they are still in_use.

      Only stopped instances have consistent disk. Running and Suspended, etc machines are not good for saving they are still in_use.
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Feb 26, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/models.py
    166 195 }
    167 196  
    168 197 def get_remote_queue_name(self, queue_id):
    198 """Returns the proper queue name based on the datastore."""
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      Which are the frequently needed queue_ids?

      Edited Feb 26, 2014
      Which are the frequently needed queue_ids?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      fixed

      fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Feb 26, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/models.py
    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.
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      What is an empty Disk?

      What is an empty Disk?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      fixed

      fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Feb 26, 2014
    Last updated by Őry Máté Feb 26, 2014
    circle/storage/models.py
    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
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      rly?

      rly?
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      fixed

      fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on the diff Feb 26, 2014
    Last updated by Őry Máté Feb 27, 2014
    circle/storage/tests/test_models.py
    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()
    • Őry Máté @orymate commented Feb 26, 2014
      Owner

      _disk(destroyed=new)

      `_disk(destroyed=new)`
    • Őry Máté @orymate commented Feb 27, 2014
      Owner

      fixed

      fixed
    Please register or sign in to reply
  • Őry Máté
    @orymate started a discussion on commit 5f8dcc9e Feb 26, 2014
    • Őry Máté @orymate

      mentioned in merge request !11 (merged)

      Feb 26, 2014

      mentioned in merge request !11 (merged)

      mentioned in merge request !11
      Toggle commit list
    Please register or sign in to reply
  • Write
  • Preview
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
Guba Sándor
Assignee
Guba Sándor @gubasandor
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
2
2 participants
Reference: circle/cloud!11