From 7d76335180590751177596a1fe42a4fd26b2d29a Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Fri, 30 May 2014 15:11:27 -0700 Subject: [PATCH] NSX: Fix request_id in api_client to increment Previously, the NSX request_id in the api_client would always be 0 because the current request id was stored in the class which is always initialized on each request. This patch fixes that by storing the request_id as a class variable. Change-Id: I9ff4d3eb09899fe6d14b462dddf9daddbf77873b Closes-bug: 1325100 (cherry picked from commit 7a12da7be0acd58b737aeeaa6a9ce27a848c62dc) --- neutron/plugins/vmware/api_client/eventlet_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/plugins/vmware/api_client/eventlet_request.py b/neutron/plugins/vmware/api_client/eventlet_request.py index 8986ee83ff7..9470db2352a 100644 --- a/neutron/plugins/vmware/api_client/eventlet_request.py +++ b/neutron/plugins/vmware/api_client/eventlet_request.py @@ -74,12 +74,12 @@ class EventletApiRequest(request.ApiRequest): self._green_thread = None # Retrieve and store this instance's unique request id. - self._request_id = self.CURRENT_REQUEST_ID + self._request_id = EventletApiRequest.CURRENT_REQUEST_ID # Update the class variable that tracks request id. # Request IDs wrap around at MAXIMUM_REQUEST_ID next_request_id = self._request_id + 1 next_request_id %= self.MAXIMUM_REQUEST_ID - self.CURRENT_REQUEST_ID = next_request_id + EventletApiRequest.CURRENT_REQUEST_ID = next_request_id @classmethod def _spawn(cls, func, *args, **kwargs):