Drop use of features removed in Django 4.0

These functions were deprecated in Django 3.0 and have been removed
in Django 4.0. Switch to the functions they were aliased to.

Closes-Bug: #2039226
Change-Id: I2180b1ccae7ca377aa5d4586bd3c5562512b5e98
This commit is contained in:
Corey Bryant 2023-10-13 10:47:34 -04:00
parent eaf8db4c84
commit 08a7342e94
29 changed files with 42 additions and 42 deletions

View File

@ -436,7 +436,7 @@ function run_integration_tests {
function babel_extract { function babel_extract {
DOMAIN=$1 DOMAIN=$1
KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2" KEYWORDS="-k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2"
KEYWORDS+=" -k ugettext_noop -k ugettext_lazy -k ungettext_lazy:1,2" KEYWORDS+=" -k gettext_noop -k gettext_lazy -k ngettext_lazy:1,2"
KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3" KEYWORDS+=" -k npgettext:1c,2,3 -k pgettext_lazy:1c,2 -k npgettext_lazy:1c,2,3"
${command_wrapper} pybabel extract -F ../babel-${DOMAIN}.cfg -o locale/${DOMAIN}.pot $KEYWORDS . ${command_wrapper} pybabel extract -F ../babel-${DOMAIN}.cfg -o locale/${DOMAIN}.pot $KEYWORDS .

View File

@ -13,7 +13,7 @@
import logging import logging
from django.conf import settings from django.conf import settings
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from openstack_dashboard.api import base from openstack_dashboard.api import base
from watcherclient import client as wc from watcherclient import client as wc

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -17,9 +17,9 @@ import logging
from django.template.defaultfilters import title # noqa from django.template.defaultfilters import title # noqa
from django import urls from django import urls
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables
@ -55,7 +55,7 @@ class ArchiveActionPlan(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Archive Action Plan", u"Archive Action Plan",
u"Archive Action Plans", u"Archive Action Plans",
count count
@ -63,7 +63,7 @@ class ArchiveActionPlan(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Action Plan archived", u"Action Plan archived",
u"Action Plans archived", u"Action Plans archived",
count count
@ -81,7 +81,7 @@ class StartActionPlan(horizon.tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
u"Start Action Plan", u"Start Action Plan",
u"Start Action Plans", u"Start Action Plans",
count count
@ -89,7 +89,7 @@ class StartActionPlan(horizon.tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
u"Action Plan started", u"Action Plan started",
u"Action Plans started", u"Action Plans started",
count count

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -15,7 +15,7 @@
import logging import logging
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
from horizon import forms from horizon import forms
import horizon.tables import horizon.tables

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -17,8 +17,8 @@ import logging
from django.template.defaultfilters import title # noqa from django.template.defaultfilters import title # noqa
from django import urls from django import urls
from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -15,7 +15,7 @@
import collections import collections
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.tables import horizon.tables
import horizon.tabs import horizon.tabs

View File

@ -20,7 +20,7 @@ import logging
from django.core import exceptions as core_exc from django.core import exceptions as core_exc
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms
from horizon import messages from horizon import messages

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,8 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import ungettext_lazy from django.utils.translation import ngettext_lazy
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables
@ -49,7 +49,7 @@ class LaunchAudit(horizon.tables.BatchAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Launch Audit", "Launch Audit",
"Launch Audits", "Launch Audits",
count count
@ -57,7 +57,7 @@ class LaunchAudit(horizon.tables.BatchAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Launched Audit", "Launched Audit",
"Launched Audits", "Launched Audits",
count count
@ -76,7 +76,7 @@ class ArchiveAuditTemplates(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Archive Template", "Archive Template",
"Archive Templates", "Archive Templates",
count count
@ -84,7 +84,7 @@ class ArchiveAuditTemplates(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Archived Template", "Archived Template",
"Archived Templates", "Archived Templates",
count count

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -17,7 +17,7 @@ import json
import logging import logging
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
from horizon import forms from horizon import forms
import horizon.tables import horizon.tables

View File

@ -19,7 +19,7 @@ Forms for starting Watcher Audits.
import logging import logging
from django.urls import reverse from django.urls import reverse
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import exceptions from horizon import exceptions
from horizon import forms from horizon import forms

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -16,9 +16,9 @@
from django import shortcuts from django import shortcuts
from django.template.defaultfilters import title # noqa from django.template.defaultfilters import title # noqa
from django import urls from django import urls
from django.utils.translation import gettext_lazy as _
from django.utils.translation import ngettext_lazy
from django.utils.translation import pgettext_lazy from django.utils.translation import pgettext_lazy
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables
@ -88,7 +88,7 @@ class ArchiveAudits(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_present(count): def action_present(count):
return ungettext_lazy( return ngettext_lazy(
"Archive Audit", "Archive Audit",
"Archive Audits", "Archive Audits",
count count
@ -96,7 +96,7 @@ class ArchiveAudits(horizon.tables.DeleteAction):
@staticmethod @staticmethod
def action_past(count): def action_past(count):
return ungettext_lazy( return ngettext_lazy(
"Archived Audit", "Archived Audit",
"Archived Audits", "Archived Audits",
count count

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -17,7 +17,7 @@ import logging
from django.urls import reverse from django.urls import reverse
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
from horizon import forms from horizon import forms
import horizon.tables import horizon.tables

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
from django.template.defaultfilters import title # noqa from django.template.defaultfilters import title # noqa
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -15,7 +15,7 @@
import logging import logging
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.tables import horizon.tables
import horizon.tabs import horizon.tabs

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon import horizon

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.messages import horizon.messages
import horizon.tables import horizon.tables

View File

@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
from horizon import tabs from horizon import tabs

View File

@ -15,7 +15,7 @@
import logging import logging
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
import horizon.exceptions import horizon.exceptions
import horizon.tables import horizon.tables
import horizon.tabs import horizon.tabs

View File

@ -10,7 +10,7 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import gettext_lazy as _
# The slug of the panel group to be added to HORIZON_CONFIG. Required. # The slug of the panel group to be added to HORIZON_CONFIG. Required.
PANEL_GROUP = 'watcher' PANEL_GROUP = 'watcher'