query: Factorize code for getting statistics value
query: Factorize code for getting statistics value

This was not only copied for the networking fields in commit 306bed0e,
but commit cfcea7ef fixed wrongly ordered parameters and didn't fix the
original. Either way, this patch merges the two cases again. The newly
added function is already tested through the tests for
_GetLiveNodeField.

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

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