mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Fix error where blkids do not return on values with spaces.
This commit is contained in:
parent
c7adb6ebf5
commit
ba2e0b7e06
@ -6,6 +6,7 @@ Module for gathering disk information
|
||||
# Import python libs
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
|
||||
# Import salt libs
|
||||
import salt.utils
|
||||
@ -209,8 +210,9 @@ def blkid(device=None):
|
||||
comps = line.split()
|
||||
device = comps[0][:-1]
|
||||
info = {}
|
||||
for elem in comps[1:]:
|
||||
key, value = elem.split('=')
|
||||
device_attributes = re.split(('\"*\"'), line.partition(' ')[2])
|
||||
for key,value in zip(*[iter(device_attributes)]*2):
|
||||
key = key.strip('=').strip(' ')
|
||||
info[key] = value.strip('"')
|
||||
ret[device] = info
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user