Revision a1f445d3 lib/objects.py
b/lib/objects.py | ||
---|---|---|
314 | 314 |
|
315 | 315 |
def CreateOnSecondary(self): |
316 | 316 |
"""Test if this device needs to be created on a secondary node.""" |
317 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_LV) |
|
317 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, |
|
318 |
constants.LD_LV) |
|
318 | 319 |
|
319 | 320 |
def AssembleOnSecondary(self): |
320 | 321 |
"""Test if this device needs to be assembled on a secondary node.""" |
321 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_LV) |
|
322 |
return self.dev_type in (constants.LD_DRBD7, constants.LD_DRBD8, |
|
323 |
constants.LD_LV) |
|
322 | 324 |
|
323 | 325 |
def OpenOnSecondary(self): |
324 | 326 |
"""Test if this device needs to be opened on a secondary node.""" |
... | ... | |
335 | 337 |
""" |
336 | 338 |
if self.dev_type == constants.LD_LV or self.dev_type == constants.LD_MD_R1: |
337 | 339 |
result = [node] |
338 |
elif self.dev_type == constants.LD_DRBD7:
|
|
340 |
elif self.dev_type in constants.LDS_DRBD:
|
|
339 | 341 |
result = [self.logical_id[0], self.logical_id[1]] |
340 | 342 |
if node not in result: |
341 | 343 |
raise errors.ConfigurationError("DRBD device passed unknown node") |
... | ... | |
436 | 438 |
""" |
437 | 439 |
def _Helper(primary, sec_nodes, device): |
438 | 440 |
"""Recursively computes secondary nodes given a top device.""" |
439 |
if device.dev_type == constants.LD_DRBD7:
|
|
441 |
if device.dev_type in constants.LDS_DRBD:
|
|
440 | 442 |
nodea, nodeb, dummy = device.logical_id |
441 | 443 |
if nodea == primary: |
442 | 444 |
candidate = nodeb |
... | ... | |
488 | 490 |
if dev.dev_type == constants.LD_LV: |
489 | 491 |
lvmap[node].append(dev.logical_id[1]) |
490 | 492 |
|
491 |
elif dev.dev_type == constants.LD_DRBD7:
|
|
493 |
elif dev.dev_type in constants.LDS_DRBD:
|
|
492 | 494 |
if dev.logical_id[0] not in lvmap: |
493 | 495 |
lvmap[dev.logical_id[0]] = [] |
494 | 496 |
|
Also available in: Unified diff