]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
BSN: Set hash header to empty instead of False
authorKevin Benton <blak111@gmail.com>
Mon, 2 Jun 2014 05:43:02 +0000 (22:43 -0700)
committerKevin Benton <blak111@gmail.com>
Mon, 2 Jun 2014 05:44:27 +0000 (22:44 -0700)
Sets the consistency hash header to empty instead
of False since 'False' is handled like a string on
the backend and requires special-casing to detect.

Closes-Bug: #1325771
Change-Id: Iee1651574c01a32e78167a9bbed4e0433abbdec2

neutron/plugins/bigswitch/servermanager.py
neutron/tests/unit/bigswitch/test_servermanager.py

index 2ab629797e4cb3fbd73925a7e95e620d72d363f2..29b271cc4a32d4ffa253218f70c4989fa57cbe58 100644 (file)
@@ -131,7 +131,7 @@ class ServerProxy(object):
         headers['NeutronProxy-Agent'] = self.name
         headers['Instance-ID'] = self.neutron_id
         headers['Orchestration-Service-ID'] = ORCHESTRATION_SERVICE_ID
-        headers[HASH_MATCH_HEADER] = self.mypool.consistency_hash
+        headers[HASH_MATCH_HEADER] = self.mypool.consistency_hash or ''
         if 'keep-alive' in self.capabilities:
             headers['Connection'] = 'keep-alive'
         else:
index 914a8874431d0fd73acd603926019fe8dd4cbedb..5f086aaea410efde82e479c71f90fd33e739f7d4 100644 (file)
@@ -102,8 +102,8 @@ class ServerManagerTests(test_rp.BigSwitchProxyPluginV2TestCase):
             with self.network():
                 callheaders = rv.request.mock_calls[0][1][3]
                 self.assertIn('X-BSN-BVS-HASH-MATCH', callheaders)
-                # first call will be False to indicate no previous state hash
-                self.assertEqual(callheaders['X-BSN-BVS-HASH-MATCH'], False)
+                # first call will be empty to indicate no previous state hash
+                self.assertEqual(callheaders['X-BSN-BVS-HASH-MATCH'], '')
                 # change the header that will be received on delete call
                 rv.getresponse.return_value.getheader.return_value = 'HASH2'