Make hostname checks uniform between instance rename and add
authorIustin Pop <iustin@google.com>
Wed, 31 Oct 2012 16:10:19 +0000 (17:10 +0100)
committerIustin Pop <iustin@google.com>
Thu, 1 Nov 2012 13:00:35 +0000 (14:00 +0100)
commit233f4bc695f26dc8f6dd5f672dd5723b93d0645b
tree60ccd87fa2a2c66f4578c75aa05d3f91d1580bc7
parent4c91d2ad7a4addc4c6e73f07c27456c9954b927e
Make hostname checks uniform between instance rename and add

Currently, we have instance rename doing extra checks on the host
name, to prevent accidental wrong renames; however, instance create
doesn't do these checks (issue 291), which (if DNS is misconfigured)
can lead to hard to diagnose errors.

This patch abstracts the name checking from LUInstanceRename into a
separate function, which is then reused in both instance rename and
instance create.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Bernardo Dal Seno <bdalseno@google.com>
lib/cmdlib.py