diff --git a/lib/client/gnt_cluster.py b/lib/client/gnt_cluster.py index add24d6c8da7690564c3ef39122db274cf8f4318..b1054c90eb362537e7a68635ca953003330ae97e 100644 --- a/lib/client/gnt_cluster.py +++ b/lib/client/gnt_cluster.py @@ -949,11 +949,13 @@ def SetClusterParams(opts, args): opts.prealloc_wipe_disks is not None or opts.hv_state or opts.disk_state or - opts.ispecs_mem_size is not None or - opts.ispecs_cpu_count is not None or - opts.ispecs_disk_count is not None or - opts.ispecs_disk_size is not None or - opts.ispecs_nic_count is not None): + opts.ispecs_mem_size or + opts.ispecs_cpu_count or + opts.ispecs_disk_count or + opts.ispecs_disk_size or + opts.ispecs_nic_count or + opts.ipolicy_disk_templates is not None or + opts.ipolicy_vcpu_ratio is not None): ToStderr("Please give at least one of the parameters.") return 1 diff --git a/qa/ganeti-qa.py b/qa/ganeti-qa.py index 26f9d6876a9c65b6d3e9b7484c7847ff4300a675..669e0d3f315afed9276281acc34ebfbaf7b7c551 100755 --- a/qa/ganeti-qa.py +++ b/qa/ganeti-qa.py @@ -1,7 +1,7 @@ #!/usr/bin/python -u # -# Copyright (C) 2007, 2008, 2009, 2010, 2011 Google Inc. +# Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -160,6 +160,7 @@ def RunClusterTests(): ("cluster-verify", qa_cluster.TestClusterVerify), ("cluster-reserved-lvs", qa_cluster.TestClusterReservedLvs), # TODO: add more cluster modify tests + ("cluster-modify", qa_cluster.TestClusterModifyEmpty), ("cluster-modify", qa_cluster.TestClusterModifyBe), ("cluster-modify", qa_cluster.TestClusterModifyDisk), ("cluster-rename", qa_cluster.TestClusterRename), diff --git a/qa/qa_cluster.py b/qa/qa_cluster.py index 233cacb0c619bbfe7648b147fe341942e17b3b23..77a78fb68af538b1568b7faf8d18c989305319ea 100644 --- a/qa/qa_cluster.py +++ b/qa/qa_cluster.py @@ -1,7 +1,7 @@ # # -# Copyright (C) 2007, 2010, 2011 Google Inc. +# Copyright (C) 2007, 2010, 2011, 2012 Google Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -276,6 +276,11 @@ def TestClusterReservedLvs(): AssertCommand(cmd, fail=fail) +def TestClusterModifyEmpty(): + """gnt-cluster modify""" + AssertCommand(["gnt-cluster", "modify"], fail=True) + + def TestClusterModifyDisk(): """gnt-cluster modify -D""" for param in _FAIL_PARAMS: