Skip to content

Commit acd1ff0

Browse files
committed
Add function lvs to Host
Signed-off-by: Damien Thenot <[email protected]>
1 parent b8ce419 commit acd1ff0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/host.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,3 +699,15 @@ def enable_hsts_header(self):
699699
def disable_hsts_header(self):
700700
self.ssh(['rm', '-f', f'{XAPI_CONF_DIR}/00-XCP-ng-tests-enable-hsts-header.conf'])
701701
self.restart_toolstack(verify=True)
702+
703+
def lvs(self, vgName: Optional[str] = None, ignore_MGT: bool = True) -> List[str]:
704+
ret: List[str] = []
705+
cmd = ["lvs", "--noheadings", "-o", "LV_NAME"]
706+
if vgName:
707+
cmd.append(vgName)
708+
output = self.ssh(cmd)
709+
for line in output.splitlines():
710+
if ignore_MGT and "MGT" in line:
711+
continue
712+
ret.append(line.strip())
713+
return ret

0 commit comments

Comments
 (0)