Revision a59faf4b lib/backend.py
b/lib/backend.py | ||
---|---|---|
2226 | 2226 |
return result |
2227 | 2227 |
|
2228 | 2228 |
|
2229 |
def BlockdevGrow(disk, amount): |
|
2229 |
def BlockdevGrow(disk, amount, dryrun):
|
|
2230 | 2230 |
"""Grow a stack of block devices. |
2231 | 2231 |
|
2232 | 2232 |
This function is called recursively, with the childrens being the |
... | ... | |
2234 | 2234 |
|
2235 | 2235 |
@type disk: L{objects.Disk} |
2236 | 2236 |
@param disk: the disk to be grown |
2237 |
@type amount: integer |
|
2238 |
@param amount: the amount (in mebibytes) to grow with |
|
2239 |
@type dryrun: boolean |
|
2240 |
@param dryrun: whether to execute the operation in simulation mode |
|
2241 |
only, without actually increasing the size |
|
2237 | 2242 |
@rtype: (status, result) |
2238 |
@return: a tuple with the status of the operation |
|
2239 |
(True/False), and the errors message if status |
|
2240 |
is False |
|
2243 |
@return: a tuple with the status of the operation (True/False), and |
|
2244 |
the errors message if status is False |
|
2241 | 2245 |
|
2242 | 2246 |
""" |
2243 | 2247 |
r_dev = _RecursiveFindBD(disk) |
... | ... | |
2245 | 2249 |
_Fail("Cannot find block device %s", disk) |
2246 | 2250 |
|
2247 | 2251 |
try: |
2248 |
r_dev.Grow(amount, False)
|
|
2252 |
r_dev.Grow(amount, dryrun)
|
|
2249 | 2253 |
except errors.BlockDeviceError, err: |
2250 | 2254 |
_Fail("Failed to grow block device: %s", err, exc=True) |
2251 | 2255 |
|
Also available in: Unified diff