Skip to content

Commit 4b14411

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

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
@@ -711,3 +711,15 @@ def enable_hsts_header(self):
711711
def disable_hsts_header(self):
712712
self.ssh(['rm', '-f', f'{XAPI_CONF_DIR}/00-XCP-ng-tests-enable-hsts-header.conf'])
713713
self.restart_toolstack(verify=True)
714+
715+
def lvs(self, vgName: Optional[str] = None, ignore_MGT: bool = True) -> List[str]:
716+
ret: List[str] = []
717+
cmd = ["lvs", "--noheadings", "-o", "LV_NAME"]
718+
if vgName:
719+
cmd.append(vgName)
720+
output = self.ssh(cmd)
721+
for line in output.splitlines():
722+
if ignore_MGT and "MGT" in line:
723+
continue
724+
ret.append(line.strip())
725+
return ret

0 commit comments

Comments
 (0)