Cleanup for Sahara fields
Since 'True' is the default value for 'required', additional assignments are not needed. Change-Id: If79dfe6ffff7fe30cec91b7f233035fe2e5b510a
This commit is contained in:
parent
1ea96903f0
commit
ef2e5f3897
|
@ -36,8 +36,7 @@ class UploadFileForm(forms.SelfHandlingForm,
|
|||
sahara = saharaclient.client(request)
|
||||
self._generate_plugin_version_fields(sahara)
|
||||
|
||||
self.fields['template_file'] = forms.FileField(label=_("Template"),
|
||||
required=True)
|
||||
self.fields['template_file'] = forms.FileField(label=_("Template"))
|
||||
|
||||
def handle(self, request, data):
|
||||
try:
|
||||
|
|
|
@ -52,7 +52,6 @@ class SelectPluginAction(workflows.Action):
|
|||
|
||||
self.fields["plugin_name"] = forms.ChoiceField(
|
||||
label=_("Plugin name"),
|
||||
required=True,
|
||||
choices=plugin_choices,
|
||||
widget=forms.Select(attrs={"class": "plugin_name_choice"}))
|
||||
|
||||
|
@ -60,7 +59,6 @@ class SelectPluginAction(workflows.Action):
|
|||
field_name = plugin.name + "_version"
|
||||
choice_field = forms.ChoiceField(
|
||||
label=_("Hadoop version"),
|
||||
required=True,
|
||||
choices=[(version, version) for version in plugin.versions],
|
||||
widget=forms.Select(
|
||||
attrs={"class": "plugin_version_choice "
|
||||
|
@ -97,8 +95,7 @@ class GeneralConfigAction(workflows.Action):
|
|||
required=False,
|
||||
widget=forms.HiddenInput(attrs={"class": "hidden_to_delete_field"}))
|
||||
|
||||
cluster_template_name = forms.CharField(label=_("Template Name"),
|
||||
required=True)
|
||||
cluster_template_name = forms.CharField(label=_("Template Name"))
|
||||
|
||||
description = forms.CharField(label=_("Description"),
|
||||
required=False,
|
||||
|
|
|
@ -65,8 +65,7 @@ class GeneralConfigAction(workflows.Action):
|
|||
required=False,
|
||||
widget=forms.HiddenInput(attrs={"class": "hidden_to_delete_field"}))
|
||||
|
||||
cluster_name = forms.CharField(label=_("Cluster Name"),
|
||||
required=True)
|
||||
cluster_name = forms.CharField(label=_("Cluster Name"))
|
||||
|
||||
description = forms.CharField(label=_("Description"),
|
||||
required=False,
|
||||
|
@ -75,8 +74,7 @@ class GeneralConfigAction(workflows.Action):
|
|||
initial=(None, "None"),
|
||||
required=False)
|
||||
|
||||
image = forms.ChoiceField(label=_("Base Image"),
|
||||
required=True)
|
||||
image = forms.ChoiceField(label=_("Base Image"))
|
||||
|
||||
keypair = forms.ChoiceField(
|
||||
label=_("Keypair"),
|
||||
|
@ -92,7 +90,6 @@ class GeneralConfigAction(workflows.Action):
|
|||
if saharaclient.base.is_service_enabled(request, 'network'):
|
||||
self.fields["neutron_management_network"] = forms.ChoiceField(
|
||||
label=_("Neutron Management Network"),
|
||||
required=True,
|
||||
choices=self.populate_neutron_management_network_choices(
|
||||
request, {})
|
||||
)
|
||||
|
|
|
@ -57,8 +57,7 @@ class EditTagsForm(ImageForm):
|
|||
|
||||
|
||||
class RegisterImageForm(ImageForm):
|
||||
image_id = forms.ChoiceField(label=_("Image"),
|
||||
required=True)
|
||||
image_id = forms.ChoiceField(label=_("Image"))
|
||||
|
||||
def __init__(self, request, *args, **kwargs):
|
||||
super(RegisterImageForm, self).__init__(request, *args, **kwargs)
|
||||
|
|
|
@ -61,8 +61,7 @@ class JobExecutionGeneralConfigAction(workflows.Action):
|
|||
|
||||
if request.REQUEST.get("job_id", None) is None:
|
||||
self.fields["job"] = forms.ChoiceField(
|
||||
label=_("Job"),
|
||||
required=True)
|
||||
label=_("Job"))
|
||||
self.fields["job"].choices = self.populate_job_choices(request)
|
||||
else:
|
||||
self.fields["job"] = forms.CharField(
|
||||
|
|
|
@ -104,17 +104,14 @@ def _create_step_action(name, title, parameters, advanced_fields=None,
|
|||
def build_node_group_fields(action, name, template, count):
|
||||
action.fields[name] = forms.CharField(
|
||||
label=_("Name"),
|
||||
required=True,
|
||||
widget=forms.TextInput())
|
||||
|
||||
action.fields[template] = forms.CharField(
|
||||
label=_("Node group cluster"),
|
||||
required=True,
|
||||
widget=forms.HiddenInput())
|
||||
|
||||
action.fields[count] = forms.IntegerField(
|
||||
label=_("Count"),
|
||||
required=True,
|
||||
min_value=0,
|
||||
widget=forms.HiddenInput())
|
||||
|
||||
|
@ -155,7 +152,6 @@ class PluginAndVersionMixin(object):
|
|||
|
||||
self.fields["plugin_name"] = forms.ChoiceField(
|
||||
label=_("Plugin Name"),
|
||||
required=True,
|
||||
choices=plugin_choices,
|
||||
widget=forms.Select(attrs={"class": "plugin_name_choice"}))
|
||||
|
||||
|
@ -163,7 +159,6 @@ class PluginAndVersionMixin(object):
|
|||
field_name = plugin.name + "_version"
|
||||
choice_field = forms.ChoiceField(
|
||||
label=_("Hadoop Version"),
|
||||
required=True,
|
||||
choices=[(version, version) for version in plugin.versions],
|
||||
widget=forms.Select(
|
||||
attrs={"class": "plugin_version_choice "
|
||||
|
|
Loading…
Reference in New Issue