Revision acec9d51 lib/objects.py
b/lib/objects.py | ||
---|---|---|
372 | 372 |
# be different) |
373 | 373 |
return result |
374 | 374 |
|
375 |
def RecordGrow(self, amount): |
|
376 |
"""Update the size of this disk after growth. |
|
377 |
|
|
378 |
This method recurses over the disks's children and updates their |
|
379 |
size correspondigly. The method needs to be kept in sync with the |
|
380 |
actual algorithms from bdev. |
|
381 |
|
|
382 |
""" |
|
383 |
if self.dev_type == constants.LD_LV: |
|
384 |
self.size += amount |
|
385 |
elif self.dev_type == constants.LD_DRBD8: |
|
386 |
if self.children: |
|
387 |
self.children[0].RecordGrow(amount) |
|
388 |
self.size += amount |
|
389 |
else: |
|
390 |
raise errors.ProgrammerError("Disk.RecordGrow called for unsupported" |
|
391 |
" disk type %s" % self.dev_type) |
|
392 |
|
|
375 | 393 |
def ToDict(self): |
376 | 394 |
"""Disk-specific conversion to standard python types. |
377 | 395 |
|
Also available in: Unified diff