Check that instance exists before confirm. queries
authorIustin Pop <iustin@google.com>
Thu, 29 Jan 2009 15:08:24 +0000 (15:08 +0000)
committerIustin Pop <iustin@google.com>
Thu, 29 Jan 2009 15:08:24 +0000 (15:08 +0000)
commita76f0c4a5726ec1dc17c7d9986a5e16e76a23228
tree27ea065e0c247128340518aebbfaa0a704e99e44
parent18cb43a2303039a489687391b035af2b5511d8c2
Check that instance exists before confirm. queries

Currently we ask the user for confirmation, and only after (try to)
remove, failover or migrate the instance. This doesn't work nicely if
the instance doesn't exist, so we make a query for the instance before
the prompt, which will throw an error in case it doesn't exist.

Side-note: the way the query works today is not really nice. It would be
better if we could query explicitly for a missing instance name, so that
this is done cleaner (explicit check) instead of side-effect (throw
exception). We do add code for this explicit check, except that today it
won't be used actually.

Reviewed-by: ultrotter
scripts/gnt-instance