Allow instance disks to be added with --no-wait-for-sync
authorHrvoje Ribicic <riba@google.com>
Mon, 11 Aug 2014 13:58:22 +0000 (15:58 +0200)
committerHrvoje Ribicic <riba@google.com>
Tue, 12 Aug 2014 12:12:57 +0000 (14:12 +0200)
commite290ac5bbf25db20abca829c6f39bec93a8a3ec1
tree4145a706c6845a1daf2fe64ba96200209f281ee1
parente4b27f2d6db449af9a23929354eee62c4287b4ec
Allow instance disks to be added with --no-wait-for-sync

The patch 3c260845147c6dad35e37c03ba9a7556814f3f3f fixed a bug where
adding a new disk to an instance with deactivated disks activated the
disk. However, it also introduced some erroneous behaviour, preventing
disks from being added to online instances with --no-wait-for-sync.

In line with the original meaning of the patch, this patch modifies the
check to disallow adding disks to shutdown instances with
--no-wait-for-sync, and allow doing so for online instances.

Signed-off-by: Hrvoje Ribicic <riba@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
lib/cmdlib/instance.py
test/py/cmdlib/instance_unittest.py