Revision cb2037a2

b/lib/backend.py
210 210
  """Compute list of logical volumes and their size.
211 211

  
212 212
  Returns:
213
    dictionary of all partions (key) with their size:
214
    test1: 20.06MiB
213
    dictionary of all partions (key) with their size (in MiB), inactive
214
    and online status:
215
    {'test1': ('20.06', True, True)}
215 216

  
216 217
  """
217
  result = utils.RunCmd(["lvs", "--noheadings", "--units=m",
218
                         "-oname,size", vg_name])
218
  lvs = {}
219
  sep = '|'
220
  result = utils.RunCmd(["lvs", "--noheadings", "--units=m", "--nosuffix",
221
                         "--separator=%s" % sep,
222
                         "-olv_name,lv_size,lv_attr", vg_name])
219 223
  if result.failed:
220 224
    logger.Error("Failed to list logical volumes, lvs output: %s" %
221 225
                 result.output)
222
    return {}
223

  
224
  lvlist = [line.split() for line in result.stdout.splitlines()]
225
  return dict(lvlist)
226
    return lvs
227

  
228
  for line in result.stdout.splitlines():
229
    line = line.strip().rstrip(sep)
230
    name, size, attr = line.split(sep)
231
    if len(attr) != 6:
232
      attr = '------'
233
    inactive = attr[4] == '-'
234
    online = attr[5] == 'o'
235
    lvs[name] = (size, inactive, online)
236

  
237
  return lvs
226 238

  
227 239

  
228 240
def ListVolumeGroups():
b/lib/constants.py
25 25

  
26 26
# various versions
27 27
CONFIG_VERSION = 3
28
PROTOCOL_VERSION = 7
28
PROTOCOL_VERSION = 8
29 29
RELEASE_VERSION = _autoconf.PACKAGE_VERSION
30 30
OS_API_VERSION = 5
31 31
EXPORT_VERSION = 0

Also available in: Unified diff