Skip to content
Snippets Groups Projects
Commit 085b8e24 authored by Thomas Thrainer's avatar Thomas Thrainer
Browse files

Fix `drbdsetup show` parsing for DRBD 8.4


In DRBD 8.4, Ganeti does no longer use indexed external meta data but
flexible external metadata. Therefore, there is no longer a meta data
index in the output of `drbdsetup show`.

Signed-off-by: default avatarThomas Thrainer <thomasth@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 32f88ce7
No related branches found
No related tags found
No related merge requests found
...@@ -320,8 +320,8 @@ class DRBD8Dev(base.BlockDev): ...@@ -320,8 +320,8 @@ class DRBD8Dev(base.BlockDev):
if meta is not None: if meta is not None:
retval = retval and ("meta_dev" in info and retval = retval and ("meta_dev" in info and
info["meta_dev"] == meta.dev_path) info["meta_dev"] == meta.dev_path)
retval = retval and ("meta_index" in info and if "meta_index" in info:
info["meta_index"] == 0) retval = retval and info["meta_index"] == 0
else: else:
retval = retval and ("meta_dev" not in info and retval = retval and ("meta_dev" not in info and
"meta_index" not in info) "meta_index" not in info)
...@@ -830,7 +830,7 @@ class DRBD8Dev(base.BlockDev): ...@@ -830,7 +830,7 @@ class DRBD8Dev(base.BlockDev):
# no local disk, but network attached and it matches # no local disk, but network attached and it matches
self._AssembleLocal(minor, self._children[0].dev_path, self._AssembleLocal(minor, self._children[0].dev_path,
self._children[1].dev_path, self.size) self._children[1].dev_path, self.size)
if self._MatchesNet(self._GetShowInfo(minor)): if self._MatchesLocal(self._GetShowInfo(minor)):
break break
else: else:
base.ThrowError("drbd%d: disk attach successful, but 'drbdsetup" base.ThrowError("drbd%d: disk attach successful, but 'drbdsetup"
......
...@@ -442,9 +442,11 @@ class DRBD84ShowInfo(BaseShowInfo): ...@@ -442,9 +442,11 @@ class DRBD84ShowInfo(BaseShowInfo):
for inner in lst[1:]: for inner in lst[1:]:
if inner[0] == "disk" and len(inner) == 2: if inner[0] == "disk" and len(inner) == 2:
retval["local_dev"] = inner[1] retval["local_dev"] = inner[1]
elif inner[0] == "meta-disk" and len(inner) == 3: elif inner[0] == "meta-disk":
retval["meta_dev"] = inner[1] if len(inner) > 1:
retval["meta_index"] = inner[2] retval["meta_dev"] = inner[1]
if len(inner) > 2:
retval["meta_index"] = inner[2]
elif sname == "_remote_host": elif sname == "_remote_host":
for lst in section[1:]: for lst in section[1:]:
if lst[0] == "address": if lst[0] == "address":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment