Abstract check that an instance is down
Abstract check that an instance is down

Multiple LUs require that an instance is not running while they operate
on the instance (reinstall, rename, modify, recreate disks, deactivate
disks). The code to do this check is duplicate many times, and not very
consistent (some use call_instance_list, some call_instance_info).

The patch moves this check into a separate function that is then reused.
The only drawback is that _SafeShutdowInstanceDisks now raises an
OpPrereqError (even though it is run during Exec()), but this use case
is fine (there are no other modifications in that Exec).

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

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