nvmeof: Call findmnt with -v

The -v arg suppresses printing of [/dir] with the
device for bind mounts and btrfs volumes, which is
what we want for this usage.

This fixes _get_host_uuid() failing when using
a btrfs rootfs.

Closes-Bug: #2026257
Change-Id: I2d8f24193ecf821843bf8f4ea14b445561d6225c
(cherry picked from commit edc1bc433b)
This commit is contained in:
Eric Harney 2023-07-12 12:16:59 -04:00
parent ffb76e10bc
commit 9b23018e10
2 changed files with 6 additions and 1 deletions

View File

@ -783,7 +783,7 @@ class NVMeOFConnector(base.BaseLinuxConnector):
def _get_host_uuid(self) -> Optional[str]:
"""Get the UUID of the first mounted filesystem."""
cmd = ('findmnt', '/', '-n', '-o', 'SOURCE')
cmd = ('findmnt', '-v', '/', '-n', '-o', 'SOURCE')
try:
lines, err = self._execute(
*cmd, run_as_root=True, root_helper=self._root_helper)

View File

@ -0,0 +1,5 @@
---
fixes:
- |
NVMe-oF connector `bug #2026257
<https://bugs.launchpad.net/os-brick/+bug/2026257>`_: Fixes _get_host_uuid for nvmeof failing when using a btrfs root fs.