Skip to content

Commit

Permalink
Fix storage scanner parsing error
Browse files Browse the repository at this point in the history
Output separators were before set to ':', but the output values (e.g.
from command 'pvs -a') could also contain this symbol,
therefore changing separator symbol fixes this issue.

Jira: RHEL-34570
  • Loading branch information
tomasfratrik committed Aug 15, 2024
1 parent 16fb443 commit 69bbd72
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def _get_lsblk_info():
@aslist
def _get_pvs_info():
""" Collect storage info from pvs command """
for entry in _get_cmd_output(['pvs', '--noheadings', '--separator', r':'], ':', 6):
for entry in _get_cmd_output(['pvs', '--noheadings', '--separator', r'|'], '|', 6):
pv, vg, fmt, attr, psize, pfree = entry
yield PvsEntry(
pv=pv,
Expand All @@ -205,7 +205,7 @@ def _get_pvs_info():
@aslist
def _get_vgs_info():
""" Collect storage info from vgs command """
for entry in _get_cmd_output(['vgs', '--noheadings', '--separator', r':'], ':', 7):
for entry in _get_cmd_output(['vgs', '--noheadings', '--separator', r'|'], '|', 7):
vg, pv, lv, sn, attr, vsize, vfree = entry
yield VgsEntry(
vg=vg,
Expand All @@ -220,7 +220,7 @@ def _get_vgs_info():
@aslist
def _get_lvdisplay_info():
""" Collect storage info from lvdisplay command """
for entry in _get_cmd_output(['lvdisplay', '-C', '--noheadings', '--separator', r':'], ':', 12):
for entry in _get_cmd_output(['lvdisplay', '-C', '--noheadings', '--separator', r'|'], '|', 12):
lv, vg, attr, lsize, pool, origin, data, meta, move, log, cpy_sync, convert = entry
yield LvdisplayEntry(
lv=lv,
Expand Down

0 comments on commit 69bbd72

Please sign in to comment.