Revision 00fb8246 lib/objects.py
b/lib/objects.py | ||
---|---|---|
277 | 277 |
|
278 | 278 |
def CreateOnSecondary(self): |
279 | 279 |
"""Test if this device needs to be created on a secondary node.""" |
280 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, |
|
281 |
constants.LD_LV) |
|
280 |
return self.dev_type in (constants.LD_DRBD8, constants.LD_LV) |
|
282 | 281 |
|
283 | 282 |
def AssembleOnSecondary(self): |
284 | 283 |
"""Test if this device needs to be assembled on a secondary node.""" |
285 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, |
|
286 |
constants.LD_LV) |
|
284 |
return self.dev_type in (constants.LD_DRBD8, constants.LD_LV) |
|
287 | 285 |
|
288 | 286 |
def OpenOnSecondary(self): |
289 | 287 |
"""Test if this device needs to be opened on a secondary node.""" |
... | ... | |
326 | 324 |
devices needs to (or can) be assembled. |
327 | 325 |
|
328 | 326 |
""" |
329 |
if self.dev_type in [constants.LD_LV, constants.LD_MD_R1, |
|
330 |
constants.LD_FILE]: |
|
327 |
if self.dev_type in [constants.LD_LV, constants.LD_FILE]: |
|
331 | 328 |
result = [node] |
332 | 329 |
elif self.dev_type in constants.LDS_DRBD: |
333 | 330 |
result = [self.logical_id[0], self.logical_id[1]] |
... | ... | |
470 | 467 |
if self.dev_type == constants.LD_LV: |
471 | 468 |
val = "<LogicalVolume(/dev/%s/%s" % self.logical_id |
472 | 469 |
elif self.dev_type in constants.LDS_DRBD: |
473 |
if self.dev_type == constants.LD_DRBD7: |
|
474 |
val = "<DRBD7(" |
|
475 |
else: |
|
476 |
val = "<DRBD8(" |
|
470 |
val = "<DRBD8(" |
|
477 | 471 |
if self.physical_id is None: |
478 | 472 |
phy = "unconfigured" |
479 | 473 |
else: |
... | ... | |
488 | 482 |
val += "backend=%s, metadev=%s" % (self.children[0], self.children[1]) |
489 | 483 |
else: |
490 | 484 |
val += "no local storage" |
491 |
elif self.dev_type == constants.LD_MD_R1: |
|
492 |
val = "<MD_R1(uuid=%s, children=%s" % (self.physical_id, self.children) |
|
493 | 485 |
else: |
494 | 486 |
val = ("<Disk(type=%s, logical_id=%s, physical_id=%s, children=%s" % |
495 | 487 |
(self.dev_type, self.logical_id, self.physical_id, self.children)) |
Also available in: Unified diff