Revision 21bf2e2e

b/Makefile.am
454 454
	qa/qa_daemon.py \
455 455
	qa/qa_env.py \
456 456
	qa/qa_error.py \
457
	qa/qa_group.py \
457 458
	qa/qa_instance.py \
458 459
	qa/qa_node.py \
459 460
	qa/qa_os.py \
......
767 768
	$(DOCPP) \
768 769
	$(PYTHON_BOOTSTRAP)
769 770

  
771
pep8_python_code = \
772
	ganeti \
773
	ganeti/http/server.py \
774
	$(dist_sbin_SCRIPTS) \
775
	$(dist_tools_PYTHON) \
776
	$(pkglib_python_scripts) \
777
	$(BUILD_BASH_COMPLETION) \
778
	$(DOCPP) \
779
	$(PYTHON_BOOTSTRAP) \
780
	qa
781

  
770 782
test/daemon-util_unittest.bash: daemons/daemon-util
771 783

  
772 784
test/ganeti-cleaner_unittest.bash: daemons/ganeti-cleaner
......
1087 1099
		echo '"pep8" not found during configure' >&2; \
1088 1100
	else \
1089 1101
		$(PEP8) --repeat --ignore='$(PEP8_IGNORE)' --exclude='$(PEP8_EXCLUDE)' \
1090
			$(lint_python_code); \
1102
			$(pep8_python_code); \
1091 1103
	fi
1092 1104
	$(PYLINT) $(LINT_OPTS) $(lint_python_code)
1093 1105
	cd $(top_srcdir)/qa && \
b/qa/ganeti-qa.py
54 54

  
55 55
  """
56 56
  line = "---- " + line + " "
57
  line += "-" * (end-len(line))
57
  line += "-" * (end - len(line))
58 58
  line = line.rstrip()
59 59
  return line
60 60

  
b/qa/qa_cluster.py
40 40
#: cluster verify command
41 41
_CLUSTER_VERIFY = ["gnt-cluster", "verify"]
42 42

  
43

  
43 44
def _RemoveFileFromAllNodes(filename):
44 45
  """Removes a file from all nodes.
45 46

  
......
231 232
    (False, _CLUSTER_VERIFY),
232 233
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]),
233 234
    (False, ["lvcreate", "-L1G", "-nqa-test", "xenvg"]),
234
    (True,  _CLUSTER_VERIFY),
235
    (True, _CLUSTER_VERIFY),
235 236
    (False, ["gnt-cluster", "modify", "--reserved-lvs",
236 237
             "xenvg/qa-test,.*/other-test"]),
237 238
    (False, _CLUSTER_VERIFY),
238 239
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ".*/qa-.*"]),
239 240
    (False, _CLUSTER_VERIFY),
240 241
    (False, ["gnt-cluster", "modify", "--reserved-lvs", ""]),
241
    (True,  _CLUSTER_VERIFY),
242
    (True, _CLUSTER_VERIFY),
242 243
    (False, ["lvremove", "-f", "xenvg/qa-test"]),
243 244
    (False, _CLUSTER_VERIFY),
244 245
    ]:
......
251 252
    # mem
252 253
    (False, ["gnt-cluster", "modify", "-B", "memory=256"]),
253 254
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 256$'"]),
254
    (True,  ["gnt-cluster", "modify", "-B", "memory=a"]),
255
    (True, ["gnt-cluster", "modify", "-B", "memory=a"]),
255 256
    (False, ["gnt-cluster", "modify", "-B", "memory=128"]),
256 257
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *memory: 128$'"]),
257 258
    # vcpus
258 259
    (False, ["gnt-cluster", "modify", "-B", "vcpus=4"]),
259 260
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 4$'"]),
260
    (True,  ["gnt-cluster", "modify", "-B", "vcpus=a"]),
261
    (True, ["gnt-cluster", "modify", "-B", "vcpus=a"]),
261 262
    (False, ["gnt-cluster", "modify", "-B", "vcpus=1"]),
262 263
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *vcpus: 1$'"]),
263 264
    # auto_balance
264 265
    (False, ["gnt-cluster", "modify", "-B", "auto_balance=False"]),
265 266
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: False$'"]),
266
    (True,  ["gnt-cluster", "modify", "-B", "auto_balance=1"]),
267
    (True, ["gnt-cluster", "modify", "-B", "auto_balance=1"]),
267 268
    (False, ["gnt-cluster", "modify", "-B", "auto_balance=True"]),
268 269
    (False, ["sh", "-c", "gnt-cluster info|grep '^ *auto_balance: True$'"]),
269 270
    ]:
......
274 275
  if bep:
275 276
    AssertCommand(["gnt-cluster", "modify", "-B", bep])
276 277

  
278

  
277 279
def TestClusterInfo():
278 280
  """gnt-cluster info"""
279 281
  AssertCommand(["gnt-cluster", "info"])
......
306 308
    ["--new-cluster-domain-secret", "--cluster-domain-secret=/dev/null"],
307 309
    ]
308 310
  for i in conflicting:
309
    AssertCommand(cmd+i, fail=True)
311
    AssertCommand(cmd + i, fail=True)
310 312

  
311 313
  # Invalid RAPI certificate
312 314
  cmd = ["gnt-cluster", "renew-crypto", "--force",
b/qa/qa_env.py
42 42
  """Test availibility of Ganeti commands.
43 43

  
44 44
  """
45
  cmds = ( ["gnt-backup", "--version"],
45
  cmds = (["gnt-backup", "--version"],
46 46
           ["gnt-cluster", "--version"],
47 47
           ["gnt-debug", "--version"],
48 48
           ["gnt-instance", "--version"],
......
76 76
  seccmd = [pingsecondary, "-e"]
77 77
  for i in nodes:
78 78
    pricmd.append(i["primary"])
79
    if i.has_key("secondary"):
79
    if "secondary" in i:
80 80
      seccmd.append(i["secondary"])
81 81

  
82 82
  pristr = utils.ShellQuoteArgs(pricmd)
b/qa/qa_error.py
23 23

  
24 24
"""
25 25

  
26

  
26 27
class Error(Exception):
27 28
  """An error occurred during Q&A testing.
28 29

  
b/qa/qa_node.py
275 275
    # Power off on master without options should fail
276 276
    AssertCommand(["gnt-node", "power", "-f", "off", master_name], fail=True)
277 277
    # With force master it should still fail
278
    AssertCommand(["gnt-node", "power", "-f",  "--ignore-status", "off",
278
    AssertCommand(["gnt-node", "power", "-f", "--ignore-status", "off",
279 279
                   master_name],
280 280
                  fail=True)
281 281

  
......
302 302
    AssertCommand(["gnt-node", "health"], fail=True)
303 303

  
304 304
    # Correct Data, exit 0
305
    _UpdateOobFile(data_path, serializer.DumpJson({ "powered": True }))
305
    _UpdateOobFile(data_path, serializer.DumpJson({"powered": True}))
306 306

  
307 307
    AssertCommand(["gnt-node", "power", "status", node_name])
308 308
    _AssertOobCall(verify_path, "power-status %s" % full_node_name)
......
315 315

  
316 316
    AssertCommand(["gnt-node", "health"])
317 317

  
318

  
319 318
    # Those commands should fail as they expect no data regardless of exit 0
320 319
    AssertCommand(["gnt-node", "power", "on", node_name], fail=True)
321 320
    _AssertOobCall(verify_path, "power-on %s" % full_node_name)

Also available in: Unified diff