diff --git a/gbpui/client.py b/gbpui/client.py index bb0f461..932ff29 100644 --- a/gbpui/client.py +++ b/gbpui/client.py @@ -10,7 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -from __future__ import absolute_import import logging diff --git a/gbpui/column_filters.py b/gbpui/column_filters.py index 2b985a5..8318f9e 100644 --- a/gbpui/column_filters.py +++ b/gbpui/column_filters.py @@ -49,7 +49,7 @@ def update_service_policy_attributes(policy): for item in np: dl = ["
"] dl.extend(["
%s
%s
" % - (k, v) for k, v in item.items()]) + (k, v) for k, v in list(item.items())]) dl.append("
") tags.append("".join(dl)) params = mark_safe("".join(tags)) @@ -298,7 +298,7 @@ def update_l3_policy_attributes(request, l3_policy): reverse(url, kwargs={'external_connectivity_id': x.id}) + \ "'>" + x.name + "" + " : " + \ l3_policy.external_segments[x.id][0] + "" - for ec in l3_policy.external_segments.keys(): + for ec in list(l3_policy.external_segments.keys()): external_connectivity = client.get_externalconnectivity(request, ec) value.append(li(external_connectivity)) diff --git a/gbpui/panels/application_policy/tables.py b/gbpui/panels/application_policy/tables.py index 2d6af4a..e85aa6c 100644 --- a/gbpui/panels/application_policy/tables.py +++ b/gbpui/panels/application_policy/tables.py @@ -47,16 +47,16 @@ class DeletePolicyRuleSetLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Policy Rule Set", - u"Delete Policy Rule Sets", + "Delete Policy Rule Set", + "Delete Policy Rule Sets", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Policy Rule Set", - u"Scheduled deletion of Policy Rule Sets", + "Scheduled deletion of Policy Rule Set", + "Scheduled deletion of Policy Rule Sets", count ) @@ -89,16 +89,16 @@ class DeletePolicyRuleLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Policy Rule", - u"Delete Policy Rules", + "Delete Policy Rule", + "Delete Policy Rules", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Policy Rule", - u"Scheduled deletion of Policy Rules", + "Scheduled deletion of Policy Rule", + "Scheduled deletion of Policy Rules", count ) @@ -131,16 +131,16 @@ class DeletePolicyClassifierLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Policy Classifier", - u"Delete Policy Classifiers", + "Delete Policy Classifier", + "Delete Policy Classifiers", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Policy Classifier", - u"Scheduled deletion of Policy Classifiers", + "Scheduled deletion of Policy Classifier", + "Scheduled deletion of Policy Classifiers", count ) @@ -173,16 +173,16 @@ class DeletePolicyActionLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Policy Action", - u"Delete Policy Actions", + "Delete Policy Action", + "Delete Policy Actions", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Policy Action", - u"Scheduled deletion of Policy Actions", + "Scheduled deletion of Policy Action", + "Scheduled deletion of Policy Actions", count ) diff --git a/gbpui/panels/network_policy/forms.py b/gbpui/panels/network_policy/forms.py index b3280de..e9757fa 100644 --- a/gbpui/panels/network_policy/forms.py +++ b/gbpui/panels/network_policy/forms.py @@ -81,9 +81,11 @@ class AddL3PolicyForm(forms.SelfHandlingForm): ipversion = int(cleaned_data['ip_version']) subnet_prefix_length = int(cleaned_data['subnet_prefix_length']) msg = _("Subnet prefix out of range.") - if ipversion == 4 and subnet_prefix_length not in range(2, 31): + if ipversion == 4 and subnet_prefix_length not in list( + range(2, 31)): raise forms.ValidationError(msg) - if ipversion == 6 and subnet_prefix_length not in range(2, 128): + if ipversion == 6 and subnet_prefix_length not in list( + range(2, 128)): raise forms.ValidationError(msg) return cleaned_data @@ -155,7 +157,7 @@ class UpdateL3PolicyForm(AddL3PolicyForm): if bool(l3['external_segments']): es_choices = [] es_initial = [] - for key, value in l3['external_segments'].items(): + for key, value in list(l3['external_segments'].items()): val = 'ES:' + key + ',IP:' + value[0] es_choices.append((val, val)) es_initial.append(val) @@ -173,9 +175,11 @@ class UpdateL3PolicyForm(AddL3PolicyForm): ipversion = int(cleaned_data['ip_version']) subnet_prefix_length = int(cleaned_data['subnet_prefix_length']) msg = _("Subnet prefix out of range.") - if ipversion == 4 and subnet_prefix_length not in range(2, 31): + if ipversion == 4 and subnet_prefix_length not in list( + range(2, 31)): raise forms.ValidationError(msg) - if ipversion == 6 and subnet_prefix_length not in range(2, 128): + if ipversion == 6 and subnet_prefix_length not in list( + range(2, 128)): raise forms.ValidationError(msg) if cleaned_data['external_segments']: dic = {} diff --git a/gbpui/panels/network_policy/tables.py b/gbpui/panels/network_policy/tables.py index 17df3e9..5fd434b 100644 --- a/gbpui/panels/network_policy/tables.py +++ b/gbpui/panels/network_policy/tables.py @@ -46,16 +46,16 @@ class DeleteL2PolicyLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete L2 Policy", - u"Delete L2 Policies", + "Delete L2 Policy", + "Delete L2 Policies", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of L2 Policy", - u"Scheduled deletion of L2 Policies", + "Scheduled deletion of L2 Policy", + "Scheduled deletion of L2 Policies", count ) @@ -107,16 +107,16 @@ class DeleteL3PolicyLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete L3 Policy", - u"Delete L3 Policies", + "Delete L3 Policy", + "Delete L3 Policies", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of L3 Policy", - u"Scheduled deletion of L3 Policies", + "Scheduled deletion of L3 Policy", + "Scheduled deletion of L3 Policies", count ) @@ -170,16 +170,16 @@ class DeleteServicePolicyLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Network Service Policy", - u"Delete Network ServiceL3 Policies", + "Delete Network Service Policy", + "Delete Network ServiceL3 Policies", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Network Service Policy", - u"Scheduled deletion of Network Service Policies", + "Scheduled deletion of Network Service Policy", + "Scheduled deletion of Network Service Policies", count ) @@ -235,16 +235,16 @@ class DeleteExternalConnectivityLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete External Connectivity Policy", - u"Delete External Connectivity Policies", + "Delete External Connectivity Policy", + "Delete External Connectivity Policies", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of External Connectivity Policy", - u"Scheduled deletion of External Connectivity Policies", + "Scheduled deletion of External Connectivity Policy", + "Scheduled deletion of External Connectivity Policies", count ) @@ -284,16 +284,16 @@ class DeleteNATPoolLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete NAT Pool", - u"Delete NAT Pools", + "Delete NAT Pool", + "Delete NAT Pools", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of NAT Pool", - u"Scheduled deletion of NAT Pools", + "Scheduled deletion of NAT Pool", + "Scheduled deletion of NAT Pools", count ) diff --git a/gbpui/panels/network_services/tables.py b/gbpui/panels/network_services/tables.py index bdd3b1a..b2366f4 100644 --- a/gbpui/panels/network_services/tables.py +++ b/gbpui/panels/network_services/tables.py @@ -45,16 +45,16 @@ class DeleteServiceChainSpecLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Service Chain Spec", - u"Delete Service Chain Specs", + "Delete Service Chain Spec", + "Delete Service Chain Specs", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Service Chain Spec", - u"Scheduled deletion of Service Chain Specs", + "Scheduled deletion of Service Chain Spec", + "Scheduled deletion of Service Chain Specs", count ) @@ -105,16 +105,16 @@ class DeleteServiceChainNodeLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Service Chain Node", - u"Delete Service Chain Nodes", + "Delete Service Chain Node", + "Delete Service Chain Nodes", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Service Chain Node", - u"Scheduled deletion of Service Chain Nodes", + "Scheduled deletion of Service Chain Node", + "Scheduled deletion of Service Chain Nodes", count ) @@ -166,16 +166,16 @@ class DeleteServiceChainInstanceLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Service Chain Instance", - u"Delete Service Chain Instances", + "Delete Service Chain Instance", + "Delete Service Chain Instances", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Service Chain Instance", - u"Scheduled deletion of Service Chain Instances", + "Scheduled deletion of Service Chain Instance", + "Scheduled deletion of Service Chain Instances", count ) @@ -219,16 +219,16 @@ class DeleteServiceProfileLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Service Chain Profile", - u"Delete Service Chain Profiles", + "Delete Service Chain Profile", + "Delete Service Chain Profiles", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Service Chain Profile", - u"Scheduled deletion of Service Chain Profiles", + "Scheduled deletion of Service Chain Profile", + "Scheduled deletion of Service Chain Profiles", count ) diff --git a/gbpui/panels/network_services/tabs.py b/gbpui/panels/network_services/tabs.py index b8ef694..c3df132 100644 --- a/gbpui/panels/network_services/tabs.py +++ b/gbpui/panels/network_services/tabs.py @@ -160,7 +160,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab): def prepare_config_as_tree(self, config): tree = [] - for key, value in config.iteritems(): + for key, value in config.items(): node = {} if isinstance(value, dict): node = self.prepare_root_node(value) @@ -184,7 +184,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab): def prepare_children(self, obj): children = [] - for key, value in obj.iteritems(): + for key, value in obj.items(): node = {} child = self.json2array(value) node["text"] = key @@ -195,7 +195,7 @@ class ServiceChainNodeDetailsTab(tabs.Tab): def json2array(self, obj): arr = [] - for key, value in obj.iteritems(): + for key, value in obj.items(): node = {} if isinstance(value, dict): children = self.json2array(value) diff --git a/gbpui/panels/policytargets/tables.py b/gbpui/panels/policytargets/tables.py index 5d74d9a..dd0b657 100644 --- a/gbpui/panels/policytargets/tables.py +++ b/gbpui/panels/policytargets/tables.py @@ -49,16 +49,16 @@ class DeletePTGLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Group", - u"Delete Groups", + "Delete Group", + "Delete Groups", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of Group", - u"Scheduled deletion of Groups", + "Scheduled deletion of Group", + "Scheduled deletion of Groups", count ) @@ -122,16 +122,16 @@ class DeleteExternalPTGLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete External Group", - u"Delete External Groups", + "Delete External Group", + "Delete External Groups", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Scheduled deletion of External Group", - u"Scheduled deletion of External Groups", + "Scheduled deletion of External Group", + "Scheduled deletion of External Groups", count ) @@ -192,16 +192,16 @@ class RemoveVMLink(tables.DeleteAction): @staticmethod def action_present(count): return ungettext_lazy( - u"Delete Member", - u"Delete Members", + "Delete Member", + "Delete Members", count ) @staticmethod def action_past(count): return ungettext_lazy( - u"Deleted Member", - u"Deleted Members", + "Deleted Member", + "Deleted Members", count )