Remove status* fields from HealthMonitor model
Status and status_description fields of HealthMonitor model are never changed during lifetime of the object and doesn't represent the status of it's pysical implementation. Instead, status and status_description of PoolMonitorAssociation is used. Another reason for removing those fields is that HealthMonitor acts as template which is instantiated on device. Status field for template makes no sense. fixes bug 1207650 Change-Id: Iea9d7f73c3a2db43c553ed06a64fe5ff42427167
This commit is contained in:
parent
8422244f89
commit
adfa19d0bb
|
@ -130,8 +130,7 @@ class Pool(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant,
|
|||
vip = orm.relationship(Vip, backref='pool')
|
||||
|
||||
|
||||
class HealthMonitor(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant,
|
||||
models_v2.HasStatusDescription):
|
||||
class HealthMonitor(model_base.BASEV2, models_v2.HasId, models_v2.HasTenant):
|
||||
"""Represents a v2 neutron loadbalancer healthmonitor."""
|
||||
|
||||
type = sa.Column(sa.Enum("PING", "TCP", "HTTP", "HTTPS",
|
||||
|
@ -667,9 +666,7 @@ class LoadBalancerPluginDb(LoadBalancerPluginBase,
|
|||
'delay': health_monitor['delay'],
|
||||
'timeout': health_monitor['timeout'],
|
||||
'max_retries': health_monitor['max_retries'],
|
||||
'admin_state_up': health_monitor['admin_state_up'],
|
||||
'status': health_monitor['status'],
|
||||
'status_description': health_monitor['status_description']}
|
||||
'admin_state_up': health_monitor['admin_state_up']}
|
||||
# no point to add the values below to
|
||||
# the result if the 'type' is not HTTP/S
|
||||
if res['type'] in ['HTTP', 'HTTPS']:
|
||||
|
@ -692,8 +689,7 @@ class LoadBalancerPluginDb(LoadBalancerPluginBase,
|
|||
http_method=v['http_method'],
|
||||
url_path=v['url_path'],
|
||||
expected_codes=v['expected_codes'],
|
||||
admin_state_up=v['admin_state_up'],
|
||||
status=constants.ACTIVE)
|
||||
admin_state_up=v['admin_state_up'])
|
||||
context.session.add(monitor_db)
|
||||
return self._make_health_monitor_dict(monitor_db)
|
||||
|
||||
|
|
|
@ -831,8 +831,7 @@ class TestLoadBalancer(LoadBalancerPluginDbTestCase):
|
|||
('delay', 30),
|
||||
('timeout', 10),
|
||||
('max_retries', 3),
|
||||
('admin_state_up', True),
|
||||
('status', 'ACTIVE')]
|
||||
('admin_state_up', True)]
|
||||
with self.health_monitor() as monitor:
|
||||
for k, v in keys:
|
||||
self.assertEqual(monitor['health_monitor'][k], v)
|
||||
|
@ -843,8 +842,7 @@ class TestLoadBalancer(LoadBalancerPluginDbTestCase):
|
|||
('delay', 20),
|
||||
('timeout', 20),
|
||||
('max_retries', 2),
|
||||
('admin_state_up', False),
|
||||
('status', 'PENDING_UPDATE')]
|
||||
('admin_state_up', False)]
|
||||
with self.health_monitor() as monitor:
|
||||
data = {'health_monitor': {'delay': 20,
|
||||
'timeout': 20,
|
||||
|
@ -915,8 +913,7 @@ class TestLoadBalancer(LoadBalancerPluginDbTestCase):
|
|||
('delay', 30),
|
||||
('timeout', 10),
|
||||
('max_retries', 3),
|
||||
('admin_state_up', True),
|
||||
('status', 'ACTIVE')]
|
||||
('admin_state_up', True)]
|
||||
req = self.new_show_request('health_monitors',
|
||||
monitor['health_monitor']['id'],
|
||||
fmt=self.fmt)
|
||||
|
|
Loading…
Reference in New Issue