fix incorrect parsing of xfs_info
when device name ends with 'data' line matches in :
- if 'data ' in line:
closes #23352
(cherry picked from commit 3c75808c5c
)
This commit is contained in:
parent
69e5f2ae67
commit
c02b89759c
1 changed files with 4 additions and 4 deletions
|
@ -101,10 +101,10 @@ def _get_fs_size(fssize_cmd, dev, module):
|
||||||
rc, size, err = module.run_command("%s %s" % (cmd, dev))
|
rc, size, err = module.run_command("%s %s" % (cmd, dev))
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
for line in size.splitlines():
|
for line in size.splitlines():
|
||||||
#if 'data' in line:
|
col = line.split('=')
|
||||||
if 'data ' in line:
|
if col[0].strip() == 'data':
|
||||||
block_size = int(line.split('=')[2].split()[0])
|
block_size = int(col[2].split()[0])
|
||||||
block_count = int(line.split('=')[3].split(',')[0])
|
block_count = int(col[3].split(',')[0])
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
module.fail_json(msg="Failed to get block count and block size of %s with %s" % (dev, cmd), rc=rc, err=err )
|
module.fail_json(msg="Failed to get block count and block size of %s with %s" % (dev, cmd), rc=rc, err=err )
|
||||||
|
|
Loading…
Reference in a new issue