Revision 746f7476 lib/backend.py
b/lib/backend.py | ||
---|---|---|
1249 | 1249 |
|
1250 | 1250 |
""" |
1251 | 1251 |
msgs = [] |
1252 |
result = True |
|
1252 | 1253 |
r_dev = _RecursiveFindBD(disk) |
1253 | 1254 |
if r_dev is not None: |
1254 | 1255 |
r_path = r_dev.dev_path |
1255 | 1256 |
try: |
1256 |
result = r_dev.Shutdown() |
|
1257 |
r_dev.Shutdown() |
|
1258 |
DevCacheManager.RemoveCache(r_path) |
|
1257 | 1259 |
except errors.BlockDeviceError, err: |
1258 | 1260 |
msgs.append(str(err)) |
1259 | 1261 |
result = False |
1260 |
if result: |
|
1261 |
DevCacheManager.RemoveCache(r_path) |
|
1262 |
else: |
|
1263 |
result = True |
|
1262 |
|
|
1264 | 1263 |
if disk.children: |
1265 | 1264 |
for child in disk.children: |
1266 | 1265 |
c_status, c_msg = BlockdevShutdown(child) |
1267 | 1266 |
result = result and c_status |
1268 | 1267 |
if c_msg: # not an empty message |
1269 | 1268 |
msgs.append(c_msg) |
1269 |
|
|
1270 | 1270 |
return (result, "; ".join(msgs)) |
1271 | 1271 |
|
1272 | 1272 |
|
Also available in: Unified diff