Revision ffa1c0dc lib/config.py
b/lib/config.py | ||
---|---|---|
229 | 229 |
|
230 | 230 |
if disk.logical_id is None and disk.physical_id is not None: |
231 | 231 |
return |
232 |
if disk.dev_type in constants.LDS_DRBD:
|
|
233 |
pnode, snode, port = disk.logical_id |
|
232 |
if disk.dev_type == constants.LD_DRBD8:
|
|
233 |
pnode, snode, port, pminor, sminor = disk.logical_id
|
|
234 | 234 |
if node_name not in (pnode, snode): |
235 | 235 |
raise errors.ConfigurationError("DRBD device not knowing node %s" % |
236 | 236 |
node_name) |
... | ... | |
239 | 239 |
if pnode_info is None or snode_info is None: |
240 | 240 |
raise errors.ConfigurationError("Can't find primary or secondary node" |
241 | 241 |
" for %s" % str(disk)) |
242 |
p_data = (pnode_info.secondary_ip, port) |
|
243 |
s_data = (snode_info.secondary_ip, port) |
|
242 | 244 |
if pnode == node_name: |
243 |
disk.physical_id = (pnode_info.secondary_ip, port, |
|
244 |
snode_info.secondary_ip, port) |
|
245 |
disk.physical_id = p_data + s_data + (pminor,) |
|
245 | 246 |
else: # it must be secondary, we tested above |
246 |
disk.physical_id = (snode_info.secondary_ip, port, |
|
247 |
pnode_info.secondary_ip, port) |
|
247 |
disk.physical_id = s_data + p_data + (sminor,) |
|
248 | 248 |
else: |
249 | 249 |
disk.physical_id = disk.logical_id |
250 | 250 |
return |
Also available in: Unified diff