Fix RPC call and result (de)serialization
Fix RPC call and result (de)serialization

Previous version of RPC calls implementation in Haskell did not take
into account that the actual result type for queries is a list, not
a dictionary.

This patch aims at fixing the problem "for now" - it is not a pretty
solution, but it does work. Note that parsing of the result is now
split into two parts - first, we check if server's aswer is positive,
then if it is, we procede with decoding the actual result.

Values and order of some fields in the result type were changed to
reflect actual order of arguments from server responses.

AllInstancesInfo call was particularly tricky, because it returns a
dictionary where keys are instance names - and the response from
a given node is correct if all the instances were deserialized, not
just some.

Signed-off-by: Agata Murawska <4c8886dbe342c6966e25105100cfee09458faa93@google.com>
Reviewed-by: Iustin Pop <acf83a5274f31a43af6b914614365999469c1a31@google.com>

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