On Wed, Sep 26, 2012 at 10:00 AM, Iustin Pop <[email protected]> wrote:
> On Tue, Sep 25, 2012 at 06:43:55PM +0200, Agata Murawska wrote:
>> For storage_list call, the result type depends on the call parameters.
>> Therefore, we have to add call as an argument for rpcResultFill - and
>> by extension, to the typeclass.
>
> I see. So we don't have the RpcResult type class, since a RPC result is
> not standalone, but depends on the call. Damn, this is very ugly design
> (on the existing Python RPC side).
>
> LGTM for now, but I dislike moving into this direction.
>
> iustin

Just FYI, forgot to change it in one place - I take that it's still fine ;)

diff --git a/htools/Ganeti/Rpc.hs b/htools/Ganeti/Rpc.hs
index 6c2b67e..f9cac8c 100644
--- a/htools/Ganeti/Rpc.hs
+++ b/htools/Ganeti/Rpc.hs
@@ -353,7 +353,7 @@ instance RpcCall RpcCallVersion where
   rpcCallAcceptOffline _ = True
   rpcCallData call _ = J.encode [call]

-instance RpcResult RpcResultVersion where
+instance Rpc RpcCallVersion RpcResultVersion where
   rpcResultFill _ res =
     return $ case J.readJSON res of
       J.Error err -> Left $ JsonDecodeError err

Reply via email to