Fix pools going into ERROR when updating the pool
There was a bug that would cause a pool to go into ERROR if you attempted to update the CRL or client certificate on the pool. Conflicts: octavia/api/drivers/amphora_driver/v2/driver.py Change-Id: I736816247131715f5c385b4680614ec3218a2ad7 Story: 2008295 Task: 41180 (cherry picked from commit370aa4e61c
) (cherry picked from commit24e3a4d93a
) (cherry picked from commitebe234eb25
)
This commit is contained in:
parent
131c69608d
commit
a001c6aef3
|
@ -164,16 +164,16 @@ class AmphoraProviderDriver(driver_base.ProviderDriver):
|
|||
pool_dict['enabled'] = pool_dict.pop('admin_state_up')
|
||||
pool_id = pool_dict.pop('pool_id')
|
||||
if 'tls_container_ref' in pool_dict:
|
||||
pool_dict['tls_container_id'] = pool_dict.pop('tls_container_ref')
|
||||
pool_dict['tls_certificate_id'] = pool_dict.pop(
|
||||
'tls_container_ref')
|
||||
pool_dict.pop('tls_container_data', None)
|
||||
if 'ca_tls_container_ref' in pool_dict:
|
||||
pool_dict['ca_tls_certificate_id'] = pool_dict.pop(
|
||||
'ca_tls_container_ref')
|
||||
pool_dict.pop('ca_tls_container_data', None)
|
||||
if 'client_crl_container_ref' in pool_dict:
|
||||
pool_dict['client_crl_container_id'] = pool_dict.pop(
|
||||
'client_crl_container_ref')
|
||||
pool_dict.pop('client_crl_container_data', None)
|
||||
if 'crl_container_ref' in pool_dict:
|
||||
pool_dict['crl_container_id'] = pool_dict.pop('crl_container_ref')
|
||||
pool_dict.pop('crl_container_data', None)
|
||||
|
||||
payload = {consts.POOL_ID: pool_id,
|
||||
consts.POOL_UPDATES: pool_dict}
|
||||
|
|
|
@ -160,16 +160,17 @@ class AmphoraProviderDriver(driver_base.ProviderDriver):
|
|||
pool_dict['enabled'] = pool_dict.pop('admin_state_up')
|
||||
pool_id = pool_dict.pop('pool_id')
|
||||
if 'tls_container_ref' in pool_dict:
|
||||
pool_dict['tls_container_id'] = pool_dict.pop('tls_container_ref')
|
||||
pool_dict['tls_certificate_id'] = pool_dict.pop(
|
||||
'tls_container_ref')
|
||||
pool_dict.pop('tls_container_data', None)
|
||||
if 'ca_tls_container_ref' in pool_dict:
|
||||
pool_dict['ca_tls_certificate_id'] = pool_dict.pop(
|
||||
'ca_tls_container_ref')
|
||||
pool_dict.pop('ca_tls_container_data', None)
|
||||
if 'client_crl_container_ref' in pool_dict:
|
||||
pool_dict['client_crl_container_id'] = pool_dict.pop(
|
||||
'client_crl_container_ref')
|
||||
pool_dict.pop('client_crl_container_data', None)
|
||||
if 'crl_container_ref' in pool_dict:
|
||||
pool_dict['crl_container_id'] = pool_dict.pop(
|
||||
'crl_container_ref')
|
||||
pool_dict.pop('crl_container_data', None)
|
||||
|
||||
payload = {consts.POOL_ID: pool_id,
|
||||
consts.POOL_UPDATES: pool_dict}
|
||||
|
|
|
@ -195,8 +195,19 @@ class TestAmphoraDriver(base.TestRpc):
|
|||
old_provider_pool = driver_dm.Pool(
|
||||
pool_id=self.sample_data.pool1_id)
|
||||
provider_pool = driver_dm.Pool(
|
||||
pool_id=self.sample_data.pool1_id, admin_state_up=True)
|
||||
pool_dict = {'enabled': True}
|
||||
pool_id=self.sample_data.pool1_id, admin_state_up=True,
|
||||
ca_tls_container_data='CA DATA', ca_tls_container_ref='CA REF',
|
||||
crl_container_data='CRL DATA', crl_container_ref='CRL REF',
|
||||
description='TEST DESCRIPTION', name='TEST NAME',
|
||||
lb_algorithm=consts.LB_ALGORITHM_SOURCE_IP,
|
||||
session_persistence='FAKE SP', tls_container_data='TLS DATA',
|
||||
tls_container_ref='TLS REF', tls_enabled=False)
|
||||
pool_dict = {'description': 'TEST DESCRIPTION',
|
||||
'lb_algorithm': 'SOURCE_IP', 'name': 'TEST NAME',
|
||||
'session_persistence': 'FAKE SP', 'tls_enabled': False,
|
||||
'enabled': True, 'tls_certificate_id': 'TLS REF',
|
||||
'ca_tls_certificate_id': 'CA REF',
|
||||
'crl_container_id': 'CRL REF'}
|
||||
self.amp_driver.pool_update(old_provider_pool, provider_pool)
|
||||
payload = {consts.POOL_ID: self.sample_data.pool1_id,
|
||||
consts.POOL_UPDATES: pool_dict}
|
||||
|
|
|
@ -195,8 +195,19 @@ class TestAmphoraDriver(base.TestRpc):
|
|||
old_provider_pool = driver_dm.Pool(
|
||||
pool_id=self.sample_data.pool1_id)
|
||||
provider_pool = driver_dm.Pool(
|
||||
pool_id=self.sample_data.pool1_id, admin_state_up=True)
|
||||
pool_dict = {'enabled': True}
|
||||
pool_id=self.sample_data.pool1_id, admin_state_up=True,
|
||||
ca_tls_container_data='CA DATA', ca_tls_container_ref='CA REF',
|
||||
crl_container_data='CRL DATA', crl_container_ref='CRL REF',
|
||||
description='TEST DESCRIPTION', name='TEST NAME',
|
||||
lb_algorithm=consts.LB_ALGORITHM_SOURCE_IP,
|
||||
session_persistence='FAKE SP', tls_container_data='TLS DATA',
|
||||
tls_container_ref='TLS REF', tls_enabled=False)
|
||||
pool_dict = {'description': 'TEST DESCRIPTION',
|
||||
'lb_algorithm': 'SOURCE_IP', 'name': 'TEST NAME',
|
||||
'session_persistence': 'FAKE SP', 'tls_enabled': False,
|
||||
'enabled': True, 'tls_certificate_id': 'TLS REF',
|
||||
'ca_tls_certificate_id': 'CA REF',
|
||||
'crl_container_id': 'CRL REF'}
|
||||
self.amp_driver.pool_update(old_provider_pool, provider_pool)
|
||||
payload = {consts.POOL_ID: self.sample_data.pool1_id,
|
||||
consts.POOL_UPDATES: pool_dict}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed an issue were updating a CRL or client certificate on a pool would
|
||||
cause the pool to go into ERROR.
|
Loading…
Reference in New Issue