Revision f3e513ad lib/backend.py
b/lib/backend.py | ||
---|---|---|
1337 | 1337 |
return True |
1338 | 1338 |
|
1339 | 1339 |
|
1340 |
def RenameBlockDevices(devlist): |
|
1341 |
"""Rename a list of block devices. |
|
1342 |
|
|
1343 |
The devlist argument is a list of tuples (disk, new_logical, |
|
1344 |
new_physical). The return value will be a combined boolean result |
|
1345 |
(True only if all renames succeeded). |
|
1346 |
|
|
1347 |
""" |
|
1348 |
result = True |
|
1349 |
for disk, unique_id in devlist: |
|
1350 |
dev = _RecursiveFindBD(disk) |
|
1351 |
if dev is None: |
|
1352 |
result = False |
|
1353 |
continue |
|
1354 |
try: |
|
1355 |
dev.Rename(unique_id) |
|
1356 |
except errors.BlockDeviceError, err: |
|
1357 |
logger.Error("Can't rename device '%s' to '%s': %s" % |
|
1358 |
(dev, unique_id, err)) |
|
1359 |
result = False |
|
1360 |
return result |
|
1361 |
|
|
1362 |
|
|
1340 | 1363 |
class HooksRunner(object): |
1341 | 1364 |
"""Hook runner. |
1342 | 1365 |
|
Also available in: Unified diff