From 65f242994a4ceaf8779c24ede54b673dcee2eb26 Mon Sep 17 00:00:00 2001 From: Dmitriy Chubinidze Date: Sun, 23 Feb 2025 08:42:40 +0000 Subject: [PATCH] Fix the variable name for "Admin State" Correct the variable name for "Admin State" to be correctly displayed in dashboard. Change-Id: Iefa4a2752fa100a25c894084e0103ef674e15fdd Closes-Bug: #2099694 --- openstack_dashboard/dashboards/admin/networks/tables.py | 2 +- .../dashboards/project/networks/ports/tables.py | 2 +- openstack_dashboard/dashboards/project/networks/tables.py | 2 +- openstack_dashboard/dashboards/project/routers/tables.py | 6 +++++- releasenotes/notes/admin-state-variable.yaml | 5 +++++ 5 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/admin-state-variable.yaml diff --git a/openstack_dashboard/dashboards/admin/networks/tables.py b/openstack_dashboard/dashboards/admin/networks/tables.py index 6251c2b305..5e459f7082 100644 --- a/openstack_dashboard/dashboards/admin/networks/tables.py +++ b/openstack_dashboard/dashboards/admin/networks/tables.py @@ -92,7 +92,7 @@ class NetworksTable(tables.DataTable): status = tables.Column( "status", verbose_name=_("Status"), display_choices=project_tables.STATUS_DISPLAY_CHOICES) - admin_state = tables.Column("is_admin_state_up", + admin_state = tables.Column("admin_state", verbose_name=_("Admin State"), display_choices=DISPLAY_CHOICES) availability_zones = tables.Column(get_availability_zones, diff --git a/openstack_dashboard/dashboards/project/networks/ports/tables.py b/openstack_dashboard/dashboards/project/networks/ports/tables.py index aa62278363..c7a6c9adcb 100644 --- a/openstack_dashboard/dashboards/project/networks/ports/tables.py +++ b/openstack_dashboard/dashboards/project/networks/ports/tables.py @@ -144,7 +144,7 @@ class PortsTable(tables.DataTable): status = tables.Column("status", verbose_name=_("Status"), display_choices=STATUS_DISPLAY_CHOICES) - admin_state = tables.Column("is_admin_state_up", + admin_state = tables.Column("admin_state", verbose_name=_("Admin State"), display_choices=DISPLAY_CHOICES) mac_state = tables.Column("mac_state", empty_value=api.neutron.OFF_STATE, diff --git a/openstack_dashboard/dashboards/project/networks/tables.py b/openstack_dashboard/dashboards/project/networks/tables.py index f6c4fd0755..ebb651cf6f 100644 --- a/openstack_dashboard/dashboards/project/networks/tables.py +++ b/openstack_dashboard/dashboards/project/networks/tables.py @@ -199,7 +199,7 @@ class NetworksTable(tables.DataTable): filters=(filters.yesno, filters.capfirst)) status = tables.Column("status", verbose_name=_("Status"), display_choices=STATUS_DISPLAY_CHOICES) - admin_state = tables.Column("is_admin_state_up", + admin_state = tables.Column("admin_state", verbose_name=_("Admin State"), display_choices=DISPLAY_CHOICES) availability_zones = tables.Column(get_availability_zones, diff --git a/openstack_dashboard/dashboards/project/routers/tables.py b/openstack_dashboard/dashboards/project/routers/tables.py index 96a96416a9..9a697aaa1c 100644 --- a/openstack_dashboard/dashboards/project/routers/tables.py +++ b/openstack_dashboard/dashboards/project/routers/tables.py @@ -192,6 +192,10 @@ def get_availability_zones(router): return _("-") +def get_admin_state(router): + return _("UP") if router.is_admin_state_up else _("DOWN") + + class RoutersFilterAction(tables.FilterAction): name = 'filter_project_routers' filter_type = 'server' @@ -228,7 +232,7 @@ class RoutersTable(tables.DataTable): verbose_name=_("HA mode")) ext_net = tables.Column(get_external_network, verbose_name=_("External Network")) - admin_state = tables.Column("is_admin_state_up", + admin_state = tables.Column(get_admin_state, verbose_name=_("Admin State"), display_choices=ADMIN_STATE_DISPLAY_CHOICES) availability_zones = tables.Column(get_availability_zones, diff --git a/releasenotes/notes/admin-state-variable.yaml b/releasenotes/notes/admin-state-variable.yaml new file mode 100644 index 0000000000..1449a04f99 --- /dev/null +++ b/releasenotes/notes/admin-state-variable.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fix an error, when an "Admin State" status is displayed + as variable (true or false) instead of "UP/DOWN" [:bug: `2099694`]