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 e327f770..0425eef6 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 @@ -120,7 +120,7 @@ class CopyClusterTemplate(create_flow.ConfigureClusterTemplate): values = dict() for i, choice in enumerate(choices): share_id = choice[0] - s = filter(lambda s: s['id'] == share_id, self.template.shares) + s = [s for s in self.template.shares if s['id'] == share_id] if len(s) > 0: path = s[0]["path"] if "path" in s[0] else "" values["share_id_{0}".format(i)] = { 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 490d1f84..f6ede9d1 100644 --- a/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py +++ b/sahara_dashboard/content/data_processing/clusters/clusters/workflows/update.py @@ -53,7 +53,7 @@ class SelectSharesAction(workflows.Action): choices = share_field.choices for i, choice in enumerate(choices): share_id = choice[0] - s = filter(lambda s: s['id'] == share_id, cluster_shares) + s = [s for s in cluster_shares if s['id'] == share_id] if len(s) > 0: path = s[0]["path"] if "path" in s[0] else "" values["share_id_{0}".format(i)] = { 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 17106cb6..a3bfc5e3 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 @@ -130,7 +130,7 @@ class CopyNodegroupTemplate(create_flow.ConfigureNodegroupTemplate): choices = share_fields['shares'].choices for i, choice in enumerate(choices): share_id = choice[0] - s = filter(lambda s: s['id'] == share_id, self.template.shares) + s = [s for s in self.template.shares if s['id'] == share_id] if len(s) > 0: path = s[0].get('path', '') values["share_id_{0}".format(i)] = { diff --git a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py index 6821d8d7..c480845d 100644 --- a/sahara_dashboard/content/data_processing/utils/workflow_helpers.py +++ b/sahara_dashboard/content/data_processing/utils/workflow_helpers.py @@ -251,8 +251,8 @@ def populate_image_choices(self, request, context, empty_choice=False): class PluginAndVersionMixin(object): def _generate_plugin_version_fields(self, sahara): - plugins = sahara.plugins.list() - plugins = filter(is_plugin_not_hidden_for_user, plugins) + plugins = [p for p in sahara.plugins.list() + if is_plugin_not_hidden_for_user(p)] plugin_choices = [(plugin.name, plugin.title) for plugin in plugins] self.fields["plugin_name"] = forms.ChoiceField(