From: Tyler Smith Date: Thu, 11 Aug 2011 19:15:12 +0000 (-0700) Subject: Adding automattic serialization to all requests by moving it to do_request X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6ab0309d0bb6bf7bf30da9c6b531f43dea3c4db1;p=openstack-build%2Fneutron-build.git Adding automattic serialization to all requests by moving it to do_request --- 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)