Revision 735e1318 lib/objects.py
b/lib/objects.py | ||
---|---|---|
730 | 730 |
raise errors.ProgrammerError("Disk.RecordGrow called for unsupported" |
731 | 731 |
" disk type %s" % self.dev_type) |
732 | 732 |
|
733 |
def Update(self, size=None, mode=None): |
|
734 |
"""Apply changes to size and mode. |
|
735 |
|
|
736 |
""" |
|
737 |
if self.dev_type == constants.LD_DRBD8: |
|
738 |
if self.children: |
|
739 |
self.children[0].Update(size=size, mode=mode) |
|
740 |
else: |
|
741 |
assert not self.children |
|
742 |
|
|
743 |
if size is not None: |
|
744 |
self.size = size |
|
745 |
if mode is not None: |
|
746 |
self.mode = mode |
|
747 |
|
|
733 | 748 |
def UnsetSize(self): |
734 | 749 |
"""Sets recursively the size to zero for the disk and its children. |
735 | 750 |
|
Also available in: Unified diff