Commit 5a533f8a authored by Iustin Pop's avatar Iustin Pop
Browse files

Simplify usage of backend._FindDisks



Since all users of _FindDisks now return new-style results, we can
simply make it raise an exception and not deal with the status field.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent d3c8b360
......@@ -2339,18 +2339,16 @@ def _FindDisks(nodes_ip, disks):
for cf in disks:
rd = _RecursiveFindBD(cf)
if rd is None:
return (False, "Can't find device %s" % cf)
_Fail("Can't find device %s", cf)
bdevs.append(rd)
return (True, bdevs)
return bdevs
def DrbdDisconnectNet(nodes_ip, disks):
"""Disconnects the network on a list of drbd devices.
"""
status, bdevs = _FindDisks(nodes_ip, disks)
if not status:
return status, bdevs
bdevs = _FindDisks(nodes_ip, disks)
# disconnect disks
for rd in bdevs:
......@@ -2366,9 +2364,7 @@ def DrbdAttachNet(nodes_ip, disks, instance_name, multimaster):
"""Attaches the network on a list of drbd devices.
"""
status, bdevs = _FindDisks(nodes_ip, disks)
if not status:
return status, bdevs
bdevs = _FindDisks(nodes_ip, disks)
if multimaster:
for idx, rd in enumerate(bdevs):
......@@ -2429,9 +2425,7 @@ def DrbdWaitSync(nodes_ip, disks):
"""Wait until DRBDs have synchronized.
"""
status, bdevs = _FindDisks(nodes_ip, disks)
if not status:
return status, bdevs
bdevs = _FindDisks(nodes_ip, disks)
min_resync = 100
alldone = True
......
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