Revision 746f7476 lib/bdev.py
b/lib/bdev.py | ||
---|---|---|
455 | 455 |
volumes on shutdown. |
456 | 456 |
|
457 | 457 |
""" |
458 |
return True
|
|
458 |
pass
|
|
459 | 459 |
|
460 | 460 |
def GetSyncStatus(self): |
461 | 461 |
"""Returns the sync status of the device. |
... | ... | |
1447 | 1447 |
self._children[1].dev_path) |
1448 | 1448 |
if not result: |
1449 | 1449 |
return False |
1450 |
need_localdev_teardown = True |
|
1451 | 1450 |
if self._lhost and self._lport and self._rhost and self._rport: |
1452 | 1451 |
result = self._AssembleNet(minor, |
1453 | 1452 |
(self._lhost, self._lport, |
... | ... | |
1456 | 1455 |
hmac=constants.DRBD_HMAC_ALG, |
1457 | 1456 |
secret=self._secret) |
1458 | 1457 |
if not result: |
1459 |
if need_localdev_teardown: |
|
1460 |
# we will ignore failures from this |
|
1461 |
logging.error("net setup failed, tearing down local device") |
|
1462 |
self._ShutdownAll(minor) |
|
1463 | 1458 |
return False |
1464 | 1459 |
self._SetFromMinor(minor) |
1465 | 1460 |
return True |
... | ... | |
1498 | 1493 |
""" |
1499 | 1494 |
result = utils.RunCmd(["drbdsetup", cls._DevPath(minor), "down"]) |
1500 | 1495 |
if result.failed: |
1501 |
logging.error("Can't shutdown drbd device: %s", result.output) |
|
1502 |
return not result.failed |
|
1496 |
_ThrowError("Can't shutdown drbd device: %s", result.output) |
|
1503 | 1497 |
|
1504 | 1498 |
def Shutdown(self): |
1505 | 1499 |
"""Shutdown the DRBD device. |
1506 | 1500 |
|
1507 | 1501 |
""" |
1508 | 1502 |
if self.minor is None and not self.Attach(): |
1509 |
logging.info("DRBD device not attached to a device during Shutdown") |
|
1510 |
return True |
|
1511 |
if not self._ShutdownAll(self.minor): |
|
1512 |
return False |
|
1503 |
logging.info("drbd%d: not attached during Shutdown()", self._aminor) |
|
1504 |
return |
|
1505 |
minor = self.minor |
|
1513 | 1506 |
self.minor = None |
1514 | 1507 |
self.dev_path = None |
1515 |
return True
|
|
1508 |
self._ShutdownAll(minor)
|
|
1516 | 1509 |
|
1517 | 1510 |
def Remove(self): |
1518 | 1511 |
"""Stub remove for DRBD devices. |
... | ... | |
1602 | 1595 |
the file on shutdown. |
1603 | 1596 |
|
1604 | 1597 |
""" |
1605 |
return True
|
|
1598 |
pass
|
|
1606 | 1599 |
|
1607 | 1600 |
def Open(self, force=False): |
1608 | 1601 |
"""Make the device ready for I/O. |
Also available in: Unified diff