diff --git a/Makefile.am b/Makefile.am index f0fd8a9a2cdc431af7a6ab8b23d4679ff7e40b12..f7b2a51a71faee6070df71648c11ee90ce061b15 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1318,9 +1318,17 @@ hs-check: htools/test htools/hpc-htools $(HS_BUILT_TEST_HELPERS) HBINARY="./htools/hpc-htools" ./htools/offline-test.sh # E111: indentation is not a multiple of four +# E121: continuation line indentation is not a multiple of four +# (since our indent level is not 4) +# E125: continuation line does not distinguish itself from next logical line +# (since our indent level is not 4) +# E127: continuation line over-indented for visual indent +# (since our indent level is not 4) +# E122,E123,E126,E128,E262,E272,E502,E711,: added temporarily to not +# modify stable code; do NOT merge these into master! # E261: at least two spaces before inline comment # E501: line too long (80 characters) -PEP8_IGNORE = E111,E261,E501 +PEP8_IGNORE = E111,E121,E122,E123,E125,E126,E127,E128,E261,E262,E272,E501,E502,E711 # For excluding pep8 expects filenames only, not whole paths PEP8_EXCLUDE = $(subst $(space),$(comma),$(strip $(notdir $(BUILT_PYTHON_SOURCES)))) @@ -1406,6 +1414,19 @@ distcheck-hook: distcheck-release dist-release: export BUILD_RELEASE = 1 distcheck-release: distcheck +distrebuildcheck: dist + set -e; \ + builddir=$$(mktemp -d $(abs_srcdir)/distrebuildcheck.XXXXXXX); \ + trap "echo Removing $$builddir; cd $(abs_srcdir); rm -rf $$builddir" EXIT; \ + cd $$builddir; \ + tar xzf $(abs_srcdir)/$(distdir).tar.gz; \ + cd $(distdir); \ + ./configure; \ + $(MAKE) maintainer-clean; \ + cp $(abs_srcdir)/vcs-version .; \ + ./configure; \ + $(MAKE) $(AM_MAKEFLAGS) + dist-release: dist set -e; \ for i in $(DIST_ARCHIVES); do \ diff --git a/lib/client/gnt_node.py b/lib/client/gnt_node.py index cbf98832ec4f6641a0f9e7f5dddb1b524ff7ef02..472ae68406e0073a9b58e5eef053d263c5651dba 100644 --- a/lib/client/gnt_node.py +++ b/lib/client/gnt_node.py @@ -1001,7 +1001,7 @@ commands = { MigrateNode, ARGS_ONE_NODE, [FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT, IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT, - NORUNTIME_CHGS_OPT, SUBMIT_OPT, PRIORITY_OPT], + NORUNTIME_CHGS_OPT, SUBMIT_OPT], "[-f] <node>", "Migrate all the primary instance on a node away from it" " (only for instances of type drbd)"), diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 1111b1700b1b23c8503e17c0622943f9523d6672..6bc8e71281b9495f7e537bc840a3646a32b89074 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -8888,6 +8888,7 @@ def _WipeDisks(lu, instance): result = lu.rpc.call_blockdev_pause_resume_sync(node, (instance.disks, instance), True) + result.Raise("Failed RPC to node %s for pausing the disk syncing" % node) for idx, success in enumerate(result.payload): if not success: @@ -8935,12 +8936,17 @@ def _WipeDisks(lu, instance): (instance.disks, instance), False) - for idx, success in enumerate(result.payload): - if not success: - lu.LogWarning("Resume sync of disk %d failed, please have a" - " look at the status and troubleshoot the issue", idx) - logging.warn("resume-sync of instance %s for disks %d failed", - instance.name, idx) + if result.fail_msg: + lu.LogWarning("RPC call to %s for resuming disk syncing failed," + " please have a look at the status and troubleshoot" + " the issue: %s", node, result.fail_msg) + else: + for idx, success in enumerate(result.payload): + if not success: + lu.LogWarning("Resume sync of disk %d failed, please have a" + " look at the status and troubleshoot the issue", idx) + logging.warn("resume-sync of instance %s for disks %d failed", + instance.name, idx) def _CreateDisks(lu, instance, to_skip=None, target_node=None): @@ -9080,7 +9086,7 @@ def _ComputeDiskSizePerVG(disk_template, disks): def _ComputeDiskSize(disk_template, disks): - """Compute disk size requirements in the volume group + """Compute disk size requirements according to disk template """ # Required free disk space as a function of disk and swap space @@ -9090,10 +9096,10 @@ def _ComputeDiskSize(disk_template, disks): # 128 MB are added for drbd metadata for each disk constants.DT_DRBD8: sum(d[constants.IDISK_SIZE] + DRBD_META_SIZE for d in disks), - constants.DT_FILE: None, - constants.DT_SHARED_FILE: 0, + constants.DT_FILE: sum(d[constants.IDISK_SIZE] for d in disks), + constants.DT_SHARED_FILE: sum(d[constants.IDISK_SIZE] for d in disks), constants.DT_BLOCK: 0, - constants.DT_RBD: 0, + constants.DT_RBD: sum(d[constants.IDISK_SIZE] for d in disks), } if disk_template not in req_size_dict: diff --git a/test/gnt-cli.test b/test/gnt-cli.test index 1c1f936e39671f96305c1b63bc717fc2f3eedcac..8f4948144f3ba67ae635cc8e6d2a37361d8c6e37 100644 --- a/test/gnt-cli.test +++ b/test/gnt-cli.test @@ -70,3 +70,8 @@ $SCRIPTS/gnt-debug --version >>>/^gnt-/ >>>2 >>>= 0 + +# test that verifies all sub-commands can be run with --help, checking +# that optparse doesn't reject the options list +set -e; for c in scripts/gnt-*; do for i in $($c --help|grep '^ [^ ]'|awk '{print $1}'); do echo Checking command ${c##/}/$i; $c $i --help >/dev/null; done; done +>>>= 0