Allow proper cleanup of partially created disks
authorMichele Tartara <mtartara@google.com>
Tue, 16 Apr 2013 12:56:39 +0000 (12:56 +0000)
committerMichele Tartara <mtartara@google.com>
Mon, 22 Apr 2013 07:20:41 +0000 (09:20 +0200)
commit9b221ea4e18d8d5c432de9559628c348f9ff9cc9
tree3501f56e8cbf8376eea4ff37b0aed39000b6014a
parent568d21e4198d703e8a41da7d980c79546a6a737b
Allow proper cleanup of partially created disks

During the creation of an instance, if the creation of disks fails, some
partially created disks might remain lying around. There is an already
implemented cleanup procedure, but it requires the disks to be listed in the
disks_created variable, which is updated after the creation of the disk itself
to prevent it from removing disks already existing previously.

This patch introduces a better tracking of partially created disks, so that
they can be removed without risking removing already existing ones.

Signed-off-by: Michele Tartara <mtartara@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
lib/cmdlib.py
lib/errors.py