magnum dashboard can't be used with Django 4.x. See /var/log/apache/error.log:
[Thu Oct 12 21:11:53.240437 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_ui.content.clusters.panel: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:53.241129 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_ui.content.cluster_templates.panel: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:53.262688 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_ui.content.container_infra.quotas.panel: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:54.987658 2023] [wsgi:error] [pid 71733:tid 140109883819712] /usr/lib/python3/dist-packages/django/conf/__init__.py:267: RemovedInDjango50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale.
[Thu Oct 12 21:11:54.987699 2023] [wsgi:error] [pid 71733:tid 140109883819712] warnings.warn(USE_L10N_DEPRECATED_MSG, RemovedInDjango50Warning)
[Thu Oct 12 21:11:55.009599 2023] [wsgi:error] [pid 71733:tid 140109883819712] WARNING:root:Error importing openstack_dashboard.enabled._1370_project_container_infra_panel_group
[Thu Oct 12 21:11:55.011170 2023] [wsgi:error] [pid 71733:tid 140109883819712] ERROR:root:cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:55.011232 2023] [wsgi:error] [pid 71733:tid 140109883819712] Traceback (most recent call last):
[Thu Oct 12 21:11:55.011241 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3/dist-packages/openstack_dashboard/utils/settings.py", line 58, in import_submodules
[Thu Oct 12 21:11:55.011247 2023] [wsgi:error] [pid 71733:tid 140109883819712] submodule = import_module(name)
[Thu Oct 12 21:11:55.011253 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.011259 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
[Thu Oct 12 21:11:55.011265 2023] [wsgi:error] [pid 71733:tid 140109883819712] return _bootstrap._gcd_import(name[level:], package, level)
[Thu Oct 12 21:11:55.011271 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.011277 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[Thu Oct 12 21:11:55.011283 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[Thu Oct 12 21:11:55.011289 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[Thu Oct 12 21:11:55.011301 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[Thu Oct 12 21:11:55.011307 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[Thu Oct 12 21:11:55.011313 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[Thu Oct 12 21:11:55.011319 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3/dist-packages/openstack_dashboard/enabled/_1370_project_container_infra_panel_group.py", line 14, in <module>
[Thu Oct 12 21:11:55.011326 2023] [wsgi:error] [pid 71733:tid 140109883819712] from django.utils.translation import ugettext_lazy as _
[Thu Oct 12 21:11:55.011331 2023] [wsgi:error] [pid 71733:tid 140109883819712] ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:55.043433 2023] [wsgi:error] [pid 71733:tid 140109883819712] WARNING:root:Error importing openstack_dashboard.enabled._2370_admin_container_infra_panel_group
[Thu Oct 12 21:11:55.044698 2023] [wsgi:error] [pid 71733:tid 140109883819712] ERROR:root:cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Thu Oct 12 21:11:55.044717 2023] [wsgi:error] [pid 71733:tid 140109883819712] Traceback (most recent call last):
[Thu Oct 12 21:11:55.044722 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3/dist-packages/openstack_dashboard/utils/settings.py", line 58, in import_submodules
[Thu Oct 12 21:11:55.044726 2023] [wsgi:error] [pid 71733:tid 140109883819712] submodule = import_module(name)
[Thu Oct 12 21:11:55.044730 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.044734 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
[Thu Oct 12 21:11:55.044738 2023] [wsgi:error] [pid 71733:tid 140109883819712] return _bootstrap._gcd_import(name[level:], package, level)
[Thu Oct 12 21:11:55.044742 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.044746 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
[Thu Oct 12 21:11:55.044750 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
[Thu Oct 12 21:11:55.044766 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
[Thu Oct 12 21:11:55.044771 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
[Thu Oct 12 21:11:55.044774 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap_external>", line 940, in exec_module
[Thu Oct 12 21:11:55.044778 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
[Thu Oct 12 21:11:55.044782 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/python3/dist-packages/openstack_dashboard/enabled/_2370_admin_container_infra_panel_group.py", line 12, in <module>
[Thu Oct 12 21:11:55.044786 2023] [wsgi:error] [pid 71733:tid 140109883819712] from django.utils.translation import ugettext_lazy as _
[Thu Oct 12 21:11:55.044790 2023] [wsgi:error] [pid 71733:tid 140109883819712] ImportError: cannot import name 'ugettext_lazy' from 'django.utils.translation' (/usr/lib/python3/dist-packages/django/utils/translation/__init__.py)
[Test Case]
Deploy openstack with magnum + magnum-ui. Ensure dashboard is functional and no errors in /var/log/apache/error.log.
[Regression Potential]
This is a pretty simple change to aliased functions and regression testing mentioned above should be good enough to ensure behavior is as expected. Currently the dashboard doesn't work on Mantic where Django is at 4.2.4. This package is backported to the Bobcat cloud archive on Jammy where Django is at 3.2.12 and will need testing there, however should be fine considering these functions were deprecated in Django 3.0.
SRU details for magnum-ui
[Impact]
magnum dashboard can't be used with Django 4.x. See /var/log/ apache/ error.log:
[Thu Oct 12 21:11:53.240437 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_ ui.content. clusters. panel: cannot import name 'ugettext_lazy' from 'django. utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) ui.content. cluster_ templates. panel: cannot import name 'ugettext_lazy' from 'django. utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) ui.content. container_ infra.quotas. panel: cannot import name 'ugettext_lazy' from 'django. utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) python3/ dist-packages/ django/ conf/__ init__. py:267: RemovedInDjango 50Warning: The USE_L10N setting is deprecated. Starting with Django 5.0, localized formatting of data will always be enabled. For example Django will display numbers and dates using the format of the current locale. warn(USE_ L10N_DEPRECATED _MSG, RemovedInDjango 50Warning) dashboard. enabled. _1370_project_ container_ infra_panel_ group utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) python3/ dist-packages/ openstack_ dashboard/ utils/settings. py", line 58, in import_submodules python3. 11/importlib/ __init_ _.py", line 126, in import_module _gcd_import( name[level: ], package, level) ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ _bootstrap> ", line 1204, in _gcd_import _bootstrap> ", line 1176, in _find_and_load _bootstrap> ", line 1147, in _find_and_ load_unlocked _bootstrap> ", line 690, in _load_unlocked _bootstrap_ external> ", line 940, in exec_module _bootstrap> ", line 241, in _call_with_ frames_ removed python3/ dist-packages/ openstack_ dashboard/ enabled/ _1370_project_ container_ infra_panel_ group.py" , line 14, in <module> utils.translati on import ugettext_lazy as _ utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) dashboard. enabled. _2370_admin_ container_ infra_panel_ group utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py) python3/ dist-packages/ openstack_ dashboard/ utils/settings. py", line 58, in import_submodules python3. 11/importlib/ __init_ _.py", line 126, in import_module _gcd_import( name[level: ], package, level) ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ _bootstrap> ", line 1204, in _gcd_import _bootstrap> ", line 1176, in _find_and_load _bootstrap> ", line 1147, in _find_and_ load_unlocked _bootstrap> ", line 690, in _load_unlocked _bootstrap_ external> ", line 940, in exec_module _bootstrap> ", line 241, in _call_with_ frames_ removed python3/ dist-packages/ openstack_ dashboard/ enabled/ _2370_admin_ container_ infra_panel_ group.py" , line 12, in <module> utils.translati on import ugettext_lazy as _ utils.translati on' (/usr/lib/ python3/ dist-packages/ django/ utils/translati on/__init_ _.py)
[Thu Oct 12 21:11:53.241129 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_
[Thu Oct 12 21:11:53.262688 2023] [wsgi:error] [pid 71732:tid 140109883819712] [remote 10.5.3.66:56488] Could not import panel module magnum_
[Thu Oct 12 21:11:54.987658 2023] [wsgi:error] [pid 71733:tid 140109883819712] /usr/lib/
[Thu Oct 12 21:11:54.987699 2023] [wsgi:error] [pid 71733:tid 140109883819712] warnings.
[Thu Oct 12 21:11:55.009599 2023] [wsgi:error] [pid 71733:tid 140109883819712] WARNING:root:Error importing openstack_
[Thu Oct 12 21:11:55.011170 2023] [wsgi:error] [pid 71733:tid 140109883819712] ERROR:root:cannot import name 'ugettext_lazy' from 'django.
[Thu Oct 12 21:11:55.011232 2023] [wsgi:error] [pid 71733:tid 140109883819712] Traceback (most recent call last):
[Thu Oct 12 21:11:55.011241 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.011247 2023] [wsgi:error] [pid 71733:tid 140109883819712] submodule = import_module(name)
[Thu Oct 12 21:11:55.011253 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.011259 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.011265 2023] [wsgi:error] [pid 71733:tid 140109883819712] return _bootstrap.
[Thu Oct 12 21:11:55.011271 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^
[Thu Oct 12 21:11:55.011277 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011283 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011289 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011301 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011307 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011313 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.011319 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.011326 2023] [wsgi:error] [pid 71733:tid 140109883819712] from django.
[Thu Oct 12 21:11:55.011331 2023] [wsgi:error] [pid 71733:tid 140109883819712] ImportError: cannot import name 'ugettext_lazy' from 'django.
[Thu Oct 12 21:11:55.043433 2023] [wsgi:error] [pid 71733:tid 140109883819712] WARNING:root:Error importing openstack_
[Thu Oct 12 21:11:55.044698 2023] [wsgi:error] [pid 71733:tid 140109883819712] ERROR:root:cannot import name 'ugettext_lazy' from 'django.
[Thu Oct 12 21:11:55.044717 2023] [wsgi:error] [pid 71733:tid 140109883819712] Traceback (most recent call last):
[Thu Oct 12 21:11:55.044722 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.044726 2023] [wsgi:error] [pid 71733:tid 140109883819712] submodule = import_module(name)
[Thu Oct 12 21:11:55.044730 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^^^^^^^^^^^^^
[Thu Oct 12 21:11:55.044734 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.044738 2023] [wsgi:error] [pid 71733:tid 140109883819712] return _bootstrap.
[Thu Oct 12 21:11:55.044742 2023] [wsgi:error] [pid 71733:tid 140109883819712] ^^^^^^^
[Thu Oct 12 21:11:55.044746 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044750 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044766 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044771 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044774 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044778 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "<frozen importlib.
[Thu Oct 12 21:11:55.044782 2023] [wsgi:error] [pid 71733:tid 140109883819712] File "/usr/lib/
[Thu Oct 12 21:11:55.044786 2023] [wsgi:error] [pid 71733:tid 140109883819712] from django.
[Thu Oct 12 21:11:55.044790 2023] [wsgi:error] [pid 71733:tid 140109883819712] ImportError: cannot import name 'ugettext_lazy' from 'django.
[Test Case] apache/ error.log.
Deploy openstack with magnum + magnum-ui. Ensure dashboard is functional and no errors in /var/log/
[Regression Potential]
This is a pretty simple change to aliased functions and regression testing mentioned above should be good enough to ensure behavior is as expected. Currently the dashboard doesn't work on Mantic where Django is at 4.2.4. This package is backported to the Bobcat cloud archive on Jammy where Django is at 3.2.12 and will need testing there, however should be fine considering these functions were deprecated in Django 3.0.