Revision 0e79564a qa/qa_utils.py

b/qa/qa_utils.py
23 23

  
24 24
"""
25 25

  
26
import operator
26 27
import os
28
import random
27 29
import re
28
import sys
29 30
import subprocess
30
import random
31
import sys
31 32
import tempfile
32
import operator
33
import yaml
33 34

  
34 35
try:
35 36
  import functools
......
343 344
  return p.stdout.read()
344 345

  
345 346

  
347
def GetObjectInfo(infocmd):
348
  """Get and parse information about a Ganeti object.
349

  
350
  @type infocmd: list of strings
351
  @param infocmd: command to be executed, e.g. ["gnt-cluster", "info"]
352
  @return: the information parsed, appropriately stored in dictionaries,
353
      lists...
354

  
355
  """
356
  master = qa_config.GetMasterNode()
357
  cmdline = utils.ShellQuoteArgs(infocmd)
358
  info_out = GetCommandOutput(master.primary, cmdline)
359
  return yaml.load(info_out)
360

  
361

  
346 362
def UploadFile(node, src):
347 363
  """Uploads a file to a node and returns the filename.
348 364

  

Also available in: Unified diff