Commit 25ae22e4 authored by Iustin Pop's avatar Iustin Pop
Browse files

Do not check 'None' disk IDs for duplicates

In case of 'None' logical or physical IDs, we don't need to check them
for duplicates. This case can happen for DRBD devices in case of newly
added disks, for example.

Reviewed-by: imsnah
parent e7d81ba0
......@@ -243,14 +243,16 @@ class ConfigWriter:
"""
result = []
if disk.logical_id in l_ids:
result.append("duplicate logical id %s" % str(disk.logical_id))
else:
l_ids.append(disk.logical_id)
if disk.physical_id in p_ids:
result.append("duplicate physical id %s" % str(disk.physical_id))
else:
p_ids.append(disk.physical_id)
if disk.logical_id is not None:
if disk.logical_id in l_ids:
result.append("duplicate logical id %s" % str(disk.logical_id))
else:
l_ids.append(disk.logical_id)
if disk.physical_id is not None:
if disk.physical_id in p_ids:
result.append("duplicate physical id %s" % str(disk.physical_id))
else:
p_ids.append(disk.physical_id)
if disk.children:
for child in disk.children:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment