Merge "Admin state column added in load balancer tables"
This commit is contained in:
commit
3dddf284f7
@ -37,6 +37,8 @@ class Pool(neutron.NeutronAPIDictWrapper):
|
|||||||
def __init__(self, apiresource):
|
def __init__(self, apiresource):
|
||||||
if 'provider' not in apiresource:
|
if 'provider' not in apiresource:
|
||||||
apiresource['provider'] = None
|
apiresource['provider'] = None
|
||||||
|
apiresource['admin_state'] = \
|
||||||
|
'UP' if apiresource['admin_state_up'] else 'DOWN'
|
||||||
super(Pool, self).__init__(apiresource)
|
super(Pool, self).__init__(apiresource)
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +46,8 @@ class Member(neutron.NeutronAPIDictWrapper):
|
|||||||
"""Wrapper for neutron load balancer member."""
|
"""Wrapper for neutron load balancer member."""
|
||||||
|
|
||||||
def __init__(self, apiresource):
|
def __init__(self, apiresource):
|
||||||
|
apiresource['admin_state'] = \
|
||||||
|
'UP' if apiresource['admin_state_up'] else 'DOWN'
|
||||||
super(Member, self).__init__(apiresource)
|
super(Member, self).__init__(apiresource)
|
||||||
|
|
||||||
|
|
||||||
@ -58,6 +62,8 @@ class PoolMonitor(neutron.NeutronAPIDictWrapper):
|
|||||||
"""Wrapper for neutron load balancer pool health monitor."""
|
"""Wrapper for neutron load balancer pool health monitor."""
|
||||||
|
|
||||||
def __init__(self, apiresource):
|
def __init__(self, apiresource):
|
||||||
|
apiresource['admin_state'] = \
|
||||||
|
'UP' if apiresource['admin_state_up'] else 'DOWN'
|
||||||
super(PoolMonitor, self).__init__(apiresource)
|
super(PoolMonitor, self).__init__(apiresource)
|
||||||
|
|
||||||
|
|
||||||
|
@ -304,6 +304,12 @@ STATUS_DISPLAY_CHOICES = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ADMIN_STATE_DISPLAY_CHOICES = (
|
||||||
|
("UP", pgettext_lazy("Admin state of a Load balancer", u"UP")),
|
||||||
|
("DOWN", pgettext_lazy("Admin state of a Load balancer", u"DOWN")),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def get_vip_name(pool):
|
def get_vip_name(pool):
|
||||||
if hasattr(pool, "vip") and pool.vip:
|
if hasattr(pool, "vip") and pool.vip:
|
||||||
template_name = 'project/loadbalancers/_pool_table_vip_cell.html'
|
template_name = 'project/loadbalancers/_pool_table_vip_cell.html'
|
||||||
@ -340,6 +346,9 @@ class PoolsTable(tables.DataTable):
|
|||||||
status_choices=STATUS_CHOICES,
|
status_choices=STATUS_CHOICES,
|
||||||
display_choices=STATUS_DISPLAY_CHOICES)
|
display_choices=STATUS_DISPLAY_CHOICES)
|
||||||
vip_name = tables.Column(get_vip_name, verbose_name=_("VIP"))
|
vip_name = tables.Column(get_vip_name, verbose_name=_("VIP"))
|
||||||
|
admin_state = tables.Column("admin_state",
|
||||||
|
verbose_name=_("Admin State"),
|
||||||
|
display_choices=ADMIN_STATE_DISPLAY_CHOICES)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "poolstable"
|
name = "poolstable"
|
||||||
@ -391,6 +400,9 @@ class MembersTable(tables.DataTable):
|
|||||||
status=True,
|
status=True,
|
||||||
status_choices=STATUS_CHOICES,
|
status_choices=STATUS_CHOICES,
|
||||||
display_choices=STATUS_DISPLAY_CHOICES)
|
display_choices=STATUS_DISPLAY_CHOICES)
|
||||||
|
admin_state = tables.Column("admin_state",
|
||||||
|
verbose_name=_("Admin State"),
|
||||||
|
display_choices=ADMIN_STATE_DISPLAY_CHOICES)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "memberstable"
|
name = "memberstable"
|
||||||
@ -419,6 +431,9 @@ class MonitorsTable(tables.DataTable):
|
|||||||
timeout = tables.Column("timeout", verbose_name=_("Timeout"))
|
timeout = tables.Column("timeout", verbose_name=_("Timeout"))
|
||||||
max_retries = tables.Column("max_retries", verbose_name=_("Max Retries"))
|
max_retries = tables.Column("max_retries", verbose_name=_("Max Retries"))
|
||||||
details = tables.Column(get_monitor_details, verbose_name=_("Details"))
|
details = tables.Column(get_monitor_details, verbose_name=_("Details"))
|
||||||
|
admin_state = tables.Column("admin_state",
|
||||||
|
verbose_name=_("Admin State"),
|
||||||
|
display_choices=ADMIN_STATE_DISPLAY_CHOICES)
|
||||||
|
|
||||||
class Meta(object):
|
class Meta(object):
|
||||||
name = "monitorstable"
|
name = "monitorstable"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user