Revision a70f34d1
b/lib/bdev.py | ||
---|---|---|
2223 | 2223 |
self.dev_path = None |
2224 | 2224 |
return True |
2225 | 2225 |
|
2226 |
def Rename(self, new_uid): |
|
2227 |
"""Re-connect this device to another peer. |
|
2228 |
|
|
2229 |
""" |
|
2230 |
if self.minor is None: |
|
2231 |
raise errors.BlockDeviceError("Device not attached during rename") |
|
2232 |
if self._rhost is not None: |
|
2233 |
# this means we did have a host when we attached, so we are connected |
|
2234 |
if not self._ShutdownNet(self.minor): |
|
2235 |
raise errors.BlockDeviceError("Can't disconnect from remote peer") |
|
2236 |
old_id = self.unique_id |
|
2237 |
else: |
|
2238 |
old_id = None |
|
2239 |
self.unique_id = new_uid |
|
2240 |
if not self._AssembleNet(self.minor, self.unique_id, "C"): |
|
2241 |
logger.Error("Can't attach to new peer!") |
|
2242 |
if old_id is not None: |
|
2243 |
self._AssembleNet(self.minor, old_id, "C") |
|
2244 |
self.unique_id = old_id |
|
2245 |
raise errors.BlockDeviceError("Can't attach to new peer") |
|
2246 |
|
|
2247 | 2226 |
def Remove(self): |
2248 | 2227 |
"""Stub remove for DRBD devices. |
2249 | 2228 |
|
Also available in: Unified diff