cmdlib: Merge duplicated code for TLMigrateInstance
authorMichael Hanselmann <hansmi@google.com>
Wed, 21 Nov 2012 07:36:37 +0000 (08:36 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 21 Nov 2012 13:40:41 +0000 (14:40 +0100)
commitde0417fa1d1f2ebedcedb57ea836179eeab50666
tree5f5cc570d7b13a9f895e1b3556083f1ff95fa8f4
parentf3196d689980a66bc504348028d0ed4f30bfe220
cmdlib: Merge duplicated code for TLMigrateInstance

LUInstanceFailover and LUInstanceMigrate use TLMigrateInstance and had
the essentially same code for expanding names and declaring locks. In
LUInstanceMigrate.ExpandNames there was a mistake which led to node
resource locks not being declared properly. The two DeclareLocks methods
were exactly the same, down to the byte.

TLMigrateInstance had a lot of keyword parameters. Since it is only used
on two places, all parameters were made positional, making it easier to
determine the value of a parameter.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/cmdlib.py