From 6ab0309d0bb6bf7bf30da9c6b531f43dea3c4db1 Mon Sep 17 00:00:00 2001 From: Tyler Smith Date: Thu, 11 Aug 2011 12:15:12 -0700 Subject: [PATCH] Adding automattic serialization to all requests by moving it to do_request --- quantum/client.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/quantum/client.py b/quantum/client.py index ca05236fa..9297d3e87 100644 --- a/quantum/client.py +++ b/quantum/client.py @@ -118,6 +118,9 @@ class Client(object): if type(params) is dict: action += '?' + urllib.urlencode(params) + if body != None: + body = self.serialize(body) + try: connection_type = self.get_connection_type() headers = headers or {"Content-Type": @@ -190,7 +193,6 @@ class Client(object): """ Creates a new network on the server """ - body = self.serialize(body) return self.do_request("POST", self.networks_path, body=body) @api_call @@ -198,7 +200,6 @@ class Client(object): """ Updates a network on the server """ - body = self.serialize(body) return self.do_request("PUT", self.network_path % (network), body=body) @api_call @@ -241,7 +242,6 @@ class Client(object): """ Sets the state of a port on the server """ - body = self.serialize(body) return self.do_request("PUT", self.port_path % (network, port), body=body) @@ -257,7 +257,6 @@ class Client(object): """ Deletes a port from a network on the server """ - body = self.serialize(body) return self.do_request("PUT", self.attachment_path % (network, port), body=body) -- 2.45.2