Remove boiler-plate code about node/instance names
Remove boiler-plate code about node/instance names

Currently we have lots of duplication of the error-checking (and proper
exception raising) around node/instance name expansion. LUCreateInstance
is the only place where we have abstracted this.

This patch creates two functions (ExpandNodeName and ExpandInstanceName)
that will either raise the proper exception or return the expanded name.
This allows a lot of cleanup of duplicate code.

Signed-off-by: Iustin Pop <acf83a5274f31a43af6b914614365999469c1a31@google.com>
Reviewed-by: Michael Hanselmann <68b67885ff74281219b4a4be33cc20fd45078d7c@google.com>

mbakke/ganeti,ganeti-github-testing/ganeti-test-1,bitemyapp/ganeti,andir/ganeti,grnet/snf-ganeti,ganeti/ganeti,ganeti/ganeti,ganeti-github-testing/ganeti-test-1,yiannist/ganeti,yiannist/ganeti,onponomarev/ganeti,bitemyapp/ganeti,leshchevds/ganeti,andir/ganeti,yiannist/ganeti,apyrgio/ganeti,dimara/ganeti,mbakke/ganeti,apyrgio/snf-ganeti,ganeti/ganeti,leshchevds/ganeti,mbakke/ganeti,leshchevds/ganeti,apyrgio/snf-ganeti,andir/ganeti,apyrgio/ganeti,dimara/ganeti,onponomarev/ganeti,grnet/snf-ganeti