cmdlib: Factorize network conflict detection
authorMichael Hanselmann <hansmi@google.com>
Tue, 18 Dec 2012 17:44:23 +0000 (18:44 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 19 Dec 2012 16:55:03 +0000 (17:55 +0100)
commit892b525822a7a28269be2245f8fe078017046563
tree48c6b5dc9aff729cab0d5692a8efe8011fd839c3
parent84e110aa6d0f605b881b167f200d73d41a39d4f6
cmdlib: Factorize network conflict detection

LUNetworkConnect and LUNetworkDisconnect had very similar code to detect
conflicts between instance's network interfaces and networks. This code
factorizes the common part and does some cleanup:

- Remove single-letter variable for lambda (ā€œlā€)
- Don't repeat instance name in warning output
- Fixed error messages to match style guide

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