From a5007ee3bd06942a1b01d98cc8b665b4f6f43472 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 11 Jul 2022 13:44:50 +0900 Subject: [PATCH] Replace deprecated ugettext_lazy and ungettext_lazy The ugettext_lazy method and the ungettext_lazy method are both deprecated since Django 3.0[1]. These were already replaced in Horizon repo by [2]. [1] https://docs.djangoproject.com/en/3.0/releases/3.0/#id3 [2] cd7c1b5110fe1f64cd9dfbeb1072b37912d0efee Change-Id: I90224714987c8583a8d407f661494479db4214af --- .../cluster_templates/forms/import_forms.py | 2 +- .../clusters/cluster_templates/tables.py | 8 ++++---- .../clusters/cluster_templates/tabs.py | 2 +- .../clusters/cluster_templates/views.py | 2 +- .../cluster_templates/workflows/copy.py | 2 +- .../cluster_templates/workflows/create.py | 2 +- .../cluster_templates/workflows/edit.py | 2 +- .../clusters/clusters/tables.py | 16 +++++++-------- .../data_processing/clusters/clusters/tabs.py | 2 +- .../clusters/clusters/views.py | 2 +- .../clusters/clusters/workflows/create.py | 2 +- .../clusters/clusters/workflows/scale.py | 2 +- .../clusters/clusters/workflows/update.py | 2 +- .../clusters/image_registry/forms.py | 2 +- .../clusters/image_registry/tables.py | 8 ++++---- .../clusters/image_registry/tabs.py | 2 +- .../clusters/image_registry/views.py | 2 +- .../nodegroup_templates/forms/import_forms.py | 2 +- .../clusters/nodegroup_templates/tables.py | 8 ++++---- .../clusters/nodegroup_templates/tabs.py | 2 +- .../clusters/nodegroup_templates/views.py | 2 +- .../nodegroup_templates/workflows/copy.py | 2 +- .../nodegroup_templates/workflows/create.py | 2 +- .../nodegroup_templates/workflows/edit.py | 2 +- .../content/data_processing/clusters/panel.py | 2 +- .../content/data_processing/clusters/views.py | 2 +- .../data_processing/clusters/wizard/forms.py | 2 +- .../data_processing/clusters/wizard/views.py | 2 +- .../data_processing/data_plugins/panel.py | 2 +- .../data_processing/data_plugins/tables.py | 2 +- .../data_processing/data_plugins/tabs.py | 2 +- .../data_processing/data_plugins/views.py | 2 +- .../data_plugins/workflows/update.py | 2 +- .../jobs/data_sources/tables.py | 8 ++++---- .../data_processing/jobs/data_sources/tabs.py | 2 +- .../jobs/data_sources/views.py | 2 +- .../jobs/data_sources/workflows/create.py | 2 +- .../jobs/data_sources/workflows/edit.py | 2 +- .../jobs/job_binaries/forms.py | 2 +- .../jobs/job_binaries/tables.py | 8 ++++---- .../data_processing/jobs/job_binaries/tabs.py | 2 +- .../jobs/job_binaries/views.py | 2 +- .../jobs/job_templates/tables.py | 8 ++++---- .../jobs/job_templates/tabs.py | 2 +- .../jobs/job_templates/views.py | 2 +- .../jobs/job_templates/workflows/create.py | 2 +- .../jobs/job_templates/workflows/launch.py | 2 +- .../data_processing/jobs/jobs/tables.py | 16 +++++++-------- .../content/data_processing/jobs/jobs/tabs.py | 2 +- .../data_processing/jobs/jobs/views.py | 2 +- .../content/data_processing/jobs/panel.py | 2 +- .../content/data_processing/jobs/views.py | 2 +- .../data_processing/jobs/wizard/forms.py | 2 +- .../data_processing/jobs/wizard/views.py | 2 +- .../content/data_processing/utils/acl.py | 20 +++++++++---------- .../data_processing/utils/anti_affinity.py | 2 +- .../content/data_processing/utils/helpers.py | 8 ++++---- .../data_processing/utils/neutron_support.py | 2 +- .../data_processing/utils/workflow_helpers.py | 2 +- .../_1810_data_processing_panel_group.py | 2 +- 60 files changed, 104 insertions(+), 104 deletions(-) diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/forms/import_forms.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/forms/import_forms.py index a082192e..f48a5287 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/forms/import_forms.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/forms/import_forms.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from oslo_serialization import jsonutils as json from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/tables.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/tables.py index 1d6d4419..7717967d 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/tables.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/tables.py @@ -15,8 +15,8 @@ from django import http as http_response from django.template import defaultfilters as filters from django import urls from django.utils import http -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.tabs import base as tabs_base @@ -92,7 +92,7 @@ class EditTemplate(tables.LinkAction): class DeleteTemplate(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Template", u"Delete Templates", count @@ -100,7 +100,7 @@ class DeleteTemplate(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Template", u"Deleted Templates", count diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/tabs.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/tabs.py index 0a656e34..57e947c4 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/views.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/views.py index 1adb5939..94c71dd4 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/views.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/views.py @@ -13,7 +13,7 @@ from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/copy.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/copy.py index 0425eef6..df036c42 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/copy.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/copy.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/create.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/create.py index f7cfb52e..05cecb7f 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/create.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/create.py @@ -14,7 +14,7 @@ import json from django import urls -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/edit.py b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/edit.py index 0e409d13..12488c37 100644 --- a/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/edit.py +++ b/sahara_dashboard/content/data_processing/clusters/cluster_templates/workflows/edit.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/tables.py b/sahara_dashboard/content/data_processing/clusters/clusters/tables.py index 27eb0b24..c294a42c 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/tables.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/tables.py @@ -13,8 +13,8 @@ from django.http import Http404 # noqa from django.template.loader import render_to_string -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from saharaclient.api import base as api_base from horizon import messages @@ -65,7 +65,7 @@ class ScaleCluster(tables.LinkAction): class DeleteCluster(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Cluster", u"Delete Clusters", count @@ -73,7 +73,7 @@ class DeleteCluster(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Cluster", u"Deleted Clusters", count @@ -88,7 +88,7 @@ class CheckClusterAction(tables.BatchAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Start Verification", u"Start Verifications", count @@ -96,7 +96,7 @@ class CheckClusterAction(tables.BatchAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Started Verification", u"Started Verifications", count @@ -111,7 +111,7 @@ class ForceDeleteCluster(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Force Delete Cluster", u"Force Delete Clusters", count @@ -119,7 +119,7 @@ class ForceDeleteCluster(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Force Deleted Cluster", u"Force Deleted Clusters", count diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py b/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py index e1d33db2..dc24dd88 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from sahara_dashboard.api import sahara as saharaclient from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/views.py b/sahara_dashboard/content/data_processing/clusters/clusters/views.py index f51f3ea6..a800d091 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/views.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/views.py @@ -15,7 +15,7 @@ import json from django.http import HttpResponse from django.urls import reverse -from django.utils.translation import ugettext as _ +from django.utils.translation import gettext as _ from django.views.generic import base as django_base from oslo_utils import timeutils from saharaclient.api.base import APIException diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/create.py b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/create.py index 3c559db8..59950616 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/create.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/create.py @@ -15,7 +15,7 @@ from horizon import exceptions from horizon import forms from horizon import workflows -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from openstack_dashboard.api import nova diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/scale.py b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/scale.py index 49f14e47..44a5ca97 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/scale.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/scale.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py index f6ede9d1..0c3d37bc 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/image_registry/forms.py b/sahara_dashboard/content/data_processing/clusters/image_registry/forms.py index cc9979b4..de865ca0 100644 --- a/sahara_dashboard/content/data_processing/clusters/image_registry/forms.py +++ b/sahara_dashboard/content/data_processing/clusters/image_registry/forms.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/image_registry/tables.py b/sahara_dashboard/content/data_processing/clusters/image_registry/tables.py index 54ea18d7..a51a3db1 100644 --- a/sahara_dashboard/content/data_processing/clusters/image_registry/tables.py +++ b/sahara_dashboard/content/data_processing/clusters/image_registry/tables.py @@ -12,8 +12,8 @@ # limitations under the License. from django import template -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables @@ -46,7 +46,7 @@ class UnregisterImages(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Unregister Image", u"Unregister Images", count @@ -54,7 +54,7 @@ class UnregisterImages(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Unregistered Image", u"Unregistered Images", count diff --git a/sahara_dashboard/content/data_processing/clusters/image_registry/tabs.py b/sahara_dashboard/content/data_processing/clusters/image_registry/tabs.py index 00a9fc92..e5911abb 100644 --- a/sahara_dashboard/content/data_processing/clusters/image_registry/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/image_registry/tabs.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/clusters/image_registry/views.py b/sahara_dashboard/content/data_processing/clusters/image_registry/views.py index a6767642..c8c85251 100644 --- a/sahara_dashboard/content/data_processing/clusters/image_registry/views.py +++ b/sahara_dashboard/content/data_processing/clusters/image_registry/views.py @@ -15,7 +15,7 @@ from collections import OrderedDict import json from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/forms/import_forms.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/forms/import_forms.py index 57a72057..fdca56b9 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/forms/import_forms.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/forms/import_forms.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tables.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tables.py index 62ea34b7..a9ed0e88 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tables.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tables.py @@ -13,8 +13,8 @@ from django import http from django.template import defaultfilters as filters -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.tabs import base as tabs_base @@ -95,7 +95,7 @@ class ExportTemplate(tables.Action): class DeleteTemplate(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Template", u"Delete Templates", count @@ -103,7 +103,7 @@ class DeleteTemplate(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Template", u"Deleted Templates", count diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py index fe955030..6e2e2544 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/views.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/views.py index b5455a06..760564ba 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/views.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/views.py @@ -13,7 +13,7 @@ from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/copy.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/copy.py index a3bfc5e3..140bac14 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/copy.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/copy.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py index 9efd4b17..614ee6be 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/create.py @@ -16,7 +16,7 @@ import itertools from django.utils import encoding from django.utils import html from django.utils import safestring -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from oslo_log import log as logging from oslo_utils import uuidutils from saharaclient.api import base as api_base diff --git a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/edit.py b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/edit.py index 1646e3f5..08c960a9 100644 --- a/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/edit.py +++ b/sahara_dashboard/content/data_processing/clusters/nodegroup_templates/workflows/edit.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/clusters/panel.py b/sahara_dashboard/content/data_processing/clusters/panel.py index 09fec08a..3fff4e16 100644 --- a/sahara_dashboard/content/data_processing/clusters/panel.py +++ b/sahara_dashboard/content/data_processing/clusters/panel.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon from openstack_dashboard.dashboards.project import dashboard diff --git a/sahara_dashboard/content/data_processing/clusters/views.py b/sahara_dashboard/content/data_processing/clusters/views.py index fbe075f6..40a818a5 100644 --- a/sahara_dashboard/content/data_processing/clusters/views.py +++ b/sahara_dashboard/content/data_processing/clusters/views.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py index 0bf32297..fc313738 100644 --- a/sahara_dashboard/content/data_processing/clusters/wizard/forms.py +++ b/sahara_dashboard/content/data_processing/clusters/wizard/forms.py @@ -14,7 +14,7 @@ from django import template from django.template import defaultfilters from django.utils.encoding import force_text -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/clusters/wizard/views.py b/sahara_dashboard/content/data_processing/clusters/wizard/views.py index e78441d3..076378f9 100644 --- a/sahara_dashboard/content/data_processing/clusters/wizard/views.py +++ b/sahara_dashboard/content/data_processing/clusters/wizard/views.py @@ -13,7 +13,7 @@ from django import http from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views import generic from horizon import forms diff --git a/sahara_dashboard/content/data_processing/data_plugins/panel.py b/sahara_dashboard/content/data_processing/data_plugins/panel.py index 444f5afc..6fdf8828 100644 --- a/sahara_dashboard/content/data_processing/data_plugins/panel.py +++ b/sahara_dashboard/content/data_processing/data_plugins/panel.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon from openstack_dashboard.dashboards.project import dashboard diff --git a/sahara_dashboard/content/data_processing/data_plugins/tables.py b/sahara_dashboard/content/data_processing/data_plugins/tables.py index 4ea6bc59..c200e134 100644 --- a/sahara_dashboard/content/data_processing/data_plugins/tables.py +++ b/sahara_dashboard/content/data_processing/data_plugins/tables.py @@ -12,7 +12,7 @@ # limitations under the License. from django.template import loader -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tables diff --git a/sahara_dashboard/content/data_processing/data_plugins/tabs.py b/sahara_dashboard/content/data_processing/data_plugins/tabs.py index 4564442f..9d054ec2 100644 --- a/sahara_dashboard/content/data_processing/data_plugins/tabs.py +++ b/sahara_dashboard/content/data_processing/data_plugins/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/data_plugins/views.py b/sahara_dashboard/content/data_processing/data_plugins/views.py index e9a14a48..c6becc92 100644 --- a/sahara_dashboard/content/data_processing/data_plugins/views.py +++ b/sahara_dashboard/content/data_processing/data_plugins/views.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tables diff --git a/sahara_dashboard/content/data_processing/data_plugins/workflows/update.py b/sahara_dashboard/content/data_processing/data_plugins/workflows/update.py index 28bae631..3b87c84c 100644 --- a/sahara_dashboard/content/data_processing/data_plugins/workflows/update.py +++ b/sahara_dashboard/content/data_processing/data_plugins/workflows/update.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from saharaclient.api import base as api_base from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/jobs/data_sources/tables.py b/sahara_dashboard/content/data_processing/jobs/data_sources/tables.py index 851488c4..90736f76 100644 --- a/sahara_dashboard/content/data_processing/jobs/data_sources/tables.py +++ b/sahara_dashboard/content/data_processing/jobs/data_sources/tables.py @@ -11,8 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.tabs import base as tabs_base @@ -35,7 +35,7 @@ class CreateDataSource(tables.LinkAction): class DeleteDataSource(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Data Source", u"Delete Data Sources", count @@ -43,7 +43,7 @@ class DeleteDataSource(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Data Source", u"Deleted Data Sources", count diff --git a/sahara_dashboard/content/data_processing/jobs/data_sources/tabs.py b/sahara_dashboard/content/data_processing/jobs/data_sources/tabs.py index 0973b935..7821ec7e 100644 --- a/sahara_dashboard/content/data_processing/jobs/data_sources/tabs.py +++ b/sahara_dashboard/content/data_processing/jobs/data_sources/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/jobs/data_sources/views.py b/sahara_dashboard/content/data_processing/jobs/data_sources/views.py index e6bd1022..397cfc3f 100644 --- a/sahara_dashboard/content/data_processing/jobs/data_sources/views.py +++ b/sahara_dashboard/content/data_processing/jobs/data_sources/views.py @@ -12,7 +12,7 @@ # limitations under the License. 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 tabs diff --git a/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/create.py b/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/create.py index 733c863b..74726bbd 100644 --- a/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/create.py +++ b/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/create.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/edit.py b/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/edit.py index 5b23e0a2..6ce775e4 100644 --- a/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/edit.py +++ b/sahara_dashboard/content/data_processing/jobs/data_sources/workflows/edit.py @@ -13,7 +13,7 @@ from urllib import parse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py index 3df939f2..62eb9a30 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py +++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/forms.py @@ -19,7 +19,7 @@ from django import template from django.template import defaultfilters from django.utils.encoding import force_text from django.utils.safestring import mark_safe -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/tables.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/tables.py index 53dd5dba..594f5fa5 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_binaries/tables.py +++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/tables.py @@ -11,8 +11,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from saharaclient.api import base as api_base from horizon import tables @@ -36,7 +36,7 @@ class CreateJobBinary(tables.LinkAction): class DeleteJobBinary(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Job Binary", u"Delete Job Binaries", count @@ -44,7 +44,7 @@ class DeleteJobBinary(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Job Binary", u"Deleted Job Binaries", count diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/tabs.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/tabs.py index b016b489..0814dd2c 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_binaries/tabs.py +++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/jobs/job_binaries/views.py b/sahara_dashboard/content/data_processing/jobs/job_binaries/views.py index cb30e2bc..f3d1b860 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_binaries/views.py +++ b/sahara_dashboard/content/data_processing/jobs/job_binaries/views.py @@ -14,7 +14,7 @@ from django import http from django.urls import reverse from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import django.views from horizon import exceptions diff --git a/sahara_dashboard/content/data_processing/jobs/job_templates/tables.py b/sahara_dashboard/content/data_processing/jobs/job_templates/tables.py index 33b68a8f..818702d0 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_templates/tables.py +++ b/sahara_dashboard/content/data_processing/jobs/job_templates/tables.py @@ -13,8 +13,8 @@ from django import urls from django.utils import http -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import tables from horizon.tabs import base as tabs_base @@ -44,7 +44,7 @@ class CreateJob(tables.LinkAction): class DeleteJob(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Job Template", u"Delete Job Templates", count @@ -52,7 +52,7 @@ class DeleteJob(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Job Template", u"Deleted Jobs Templates", count diff --git a/sahara_dashboard/content/data_processing/jobs/job_templates/tabs.py b/sahara_dashboard/content/data_processing/jobs/job_templates/tabs.py index d5acf7ca..627d49ba 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_templates/tabs.py +++ b/sahara_dashboard/content/data_processing/jobs/job_templates/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/jobs/job_templates/views.py b/sahara_dashboard/content/data_processing/jobs/job_templates/views.py index a125b058..9dcf7b75 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_templates/views.py +++ b/sahara_dashboard/content/data_processing/jobs/job_templates/views.py @@ -15,7 +15,7 @@ import json from django import http 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 tabs diff --git a/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/create.py b/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/create.py index 42a74d72..53484984 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/create.py +++ b/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/create.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/launch.py b/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/launch.py index cf35b3f3..5564fd0d 100644 --- a/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/launch.py +++ b/sahara_dashboard/content/data_processing/jobs/job_templates/workflows/launch.py @@ -13,7 +13,7 @@ import json -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/jobs/jobs/tables.py b/sahara_dashboard/content/data_processing/jobs/jobs/tables.py index ba8ecf5c..40919415 100644 --- a/sahara_dashboard/content/data_processing/jobs/jobs/tables.py +++ b/sahara_dashboard/content/data_processing/jobs/jobs/tables.py @@ -14,9 +14,9 @@ from django.http import Http404 # noqa from django.urls import reverse from django.utils import http +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 ugettext_lazy as _ -from django.utils.translation import ungettext_lazy from saharaclient.api import base as api_base from horizon import messages @@ -50,7 +50,7 @@ class JobExecutionGuide(tables.LinkAction): class DeleteJob(tables.DeleteAction): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Delete Job", u"Delete Jobs", count @@ -58,7 +58,7 @@ class DeleteJob(tables.DeleteAction): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Deleted Job", u"Deleted Jobs", count @@ -71,7 +71,7 @@ class DeleteJob(tables.DeleteAction): class ReLaunchJobExistingCluster(j_t.ChoosePlugin): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Launch Job", u"Launch Jobs", count @@ -79,7 +79,7 @@ class ReLaunchJobExistingCluster(j_t.ChoosePlugin): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Launched Job", u"Launched Jobs", count @@ -104,7 +104,7 @@ class ReLaunchJobExistingCluster(j_t.ChoosePlugin): class ReLaunchJobNewCluster(ReLaunchJobExistingCluster): @staticmethod def action_present(count): - return ungettext_lazy( + return ngettext_lazy( u"Launch Job", u"Launch Jobs", count @@ -112,7 +112,7 @@ class ReLaunchJobNewCluster(ReLaunchJobExistingCluster): @staticmethod def action_past(count): - return ungettext_lazy( + return ngettext_lazy( u"Launched Job", u"Launched Jobs", count diff --git a/sahara_dashboard/content/data_processing/jobs/jobs/tabs.py b/sahara_dashboard/content/data_processing/jobs/jobs/tabs.py index bf604bd8..2f905e33 100644 --- a/sahara_dashboard/content/data_processing/jobs/jobs/tabs.py +++ b/sahara_dashboard/content/data_processing/jobs/jobs/tabs.py @@ -13,7 +13,7 @@ from oslo_log import log as logging -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/jobs/jobs/views.py b/sahara_dashboard/content/data_processing/jobs/jobs/views.py index 4663d3c9..49b91d8b 100644 --- a/sahara_dashboard/content/data_processing/jobs/jobs/views.py +++ b/sahara_dashboard/content/data_processing/jobs/jobs/views.py @@ -12,7 +12,7 @@ # limitations under the License. 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 tabs diff --git a/sahara_dashboard/content/data_processing/jobs/panel.py b/sahara_dashboard/content/data_processing/jobs/panel.py index 716d1914..d39319b9 100644 --- a/sahara_dashboard/content/data_processing/jobs/panel.py +++ b/sahara_dashboard/content/data_processing/jobs/panel.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ import horizon from openstack_dashboard.dashboards.project import dashboard diff --git a/sahara_dashboard/content/data_processing/jobs/views.py b/sahara_dashboard/content/data_processing/jobs/views.py index c0cb9f40..5aa83cbb 100644 --- a/sahara_dashboard/content/data_processing/jobs/views.py +++ b/sahara_dashboard/content/data_processing/jobs/views.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import tabs diff --git a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py index cae7db40..27223895 100644 --- a/sahara_dashboard/content/data_processing/jobs/wizard/forms.py +++ b/sahara_dashboard/content/data_processing/jobs/wizard/forms.py @@ -14,7 +14,7 @@ from django import template from django.template import defaultfilters from django.utils.encoding import force_text -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/jobs/wizard/views.py b/sahara_dashboard/content/data_processing/jobs/wizard/views.py index 537c72d2..a738ef24 100644 --- a/sahara_dashboard/content/data_processing/jobs/wizard/views.py +++ b/sahara_dashboard/content/data_processing/jobs/wizard/views.py @@ -13,7 +13,7 @@ from django import http from django.urls import reverse_lazy -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from django.views import generic from horizon import forms diff --git a/sahara_dashboard/content/data_processing/utils/acl.py b/sahara_dashboard/content/data_processing/utils/acl.py index 324e1e44..a90be42a 100644 --- a/sahara_dashboard/content/data_processing/utils/acl.py +++ b/sahara_dashboard/content/data_processing/utils/acl.py @@ -14,8 +14,8 @@ import abc import functools -from django.utils.translation import ugettext_lazy as _ -from django.utils.translation import ungettext_lazy +from django.utils.translation import gettext_lazy as _ +from django.utils.translation import ngettext_lazy from horizon import exceptions from horizon import forms @@ -24,38 +24,38 @@ from horizon import tables MESSAGE_MAPPING_PRESENT = { 'public': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Make public", u"Make public"), 'private': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Make private", u"Make private"), 'protected': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Make protected", u"Make protected"), 'unprotected': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Make unprotected", u"Make unprotected"), } MESSAGE_MAPPING_PAST = { 'public': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Made public", u"Made public"), 'private': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Made private", u"Made private"), 'protected': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Made protected", u"Made protected"), 'unprotected': functools.partial( - ungettext_lazy, + ngettext_lazy, u"Made unprotected", u"Made unprotected"), } diff --git a/sahara_dashboard/content/data_processing/utils/anti_affinity.py b/sahara_dashboard/content/data_processing/utils/anti_affinity.py index d4e9b3d5..938f6769 100644 --- a/sahara_dashboard/content/data_processing/utils/anti_affinity.py +++ b/sahara_dashboard/content/data_processing/utils/anti_affinity.py @@ -11,7 +11,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/content/data_processing/utils/helpers.py b/sahara_dashboard/content/data_processing/utils/helpers.py index f29fa9ca..6df29fc0 100644 --- a/sahara_dashboard/content/data_processing/utils/helpers.py +++ b/sahara_dashboard/content/data_processing/utils/helpers.py @@ -15,8 +15,8 @@ from pytz import timezone as ptz from django.template import defaultfilters as filters from django.utils import timezone -from django.utils.translation import ugettext -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext +from django.utils.translation import gettext_lazy as _ from oslo_utils import timeutils import sahara_dashboard.content.data_processing. \ @@ -204,6 +204,6 @@ ALLOWED_STATUSES = { # Cluster status and suitable warning message that will be displayed # in the Job Launch form STATUS_MESSAGE_MAP = { - "Error": ugettext("You\'ve chosen a cluster that is in \'Error\' state. " - "Appropriate execution of the job can't be guaranteed."), + "Error": gettext("You\'ve chosen a cluster that is in \'Error\' state. " + "Appropriate execution of the job can't be guaranteed."), } diff --git a/sahara_dashboard/content/data_processing/utils/neutron_support.py b/sahara_dashboard/content/data_processing/utils/neutron_support.py index 49ba5555..445ea202 100644 --- a/sahara_dashboard/content/data_processing/utils/neutron_support.py +++ b/sahara_dashboard/content/data_processing/utils/neutron_support.py @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from openstack_dashboard.api import neutron diff --git a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py index 20cca5f6..02089118 100644 --- a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py +++ b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py @@ -15,7 +15,7 @@ from oslo_log import log as logging from django.core.exceptions import ValidationError from django.utils import safestring -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from horizon import exceptions from horizon import forms diff --git a/sahara_dashboard/enabled/_1810_data_processing_panel_group.py b/sahara_dashboard/enabled/_1810_data_processing_panel_group.py index f14c30b1..97066e0e 100644 --- a/sahara_dashboard/enabled/_1810_data_processing_panel_group.py +++ b/sahara_dashboard/enabled/_1810_data_processing_panel_group.py @@ -9,7 +9,7 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # 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. PANEL_GROUP = 'data_processing'