~ubuntu-branches/ubuntu/vivid/horizon/vivid-proposed

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/project/data_processing/nodegroup_templates/workflows/create.py

  • Committer: Package Import Robot
  • Author(s): Corey Bryant, Chuck Short, Corey Bryant, James Page
  • Date: 2015-01-05 16:42:06 UTC
  • mfrom: (0.9.1) (1.2.5)
  • Revision ID: package-import@ubuntu.com-20150105164206-zrt2q64h4weugkur
Tags: 1:2015.1~b1-0ubuntu1
[ Chuck Short ]
* Open for Kilo.
* d/control: Update bzr branches 
* d/patches/embedded-xstatic.patch: Refreshed
* d/patches/add-juju-environment-download.patch: Temporarily disabled.

[ Corey Bryant ]
* New upstream release.
  - d/control: Align requirements with upstream.
  - d/watch: Update uversionmangle for kilo beta naming.
* d/control: Bumped Standards-Version to 3.9.6.

[ James Page ]
* d/bundle-xstatic.sh: Tweak grep to be case insensitive.
* d/p/add-juju-environment-download.patch: Rebase for kilo-1.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
    description = forms.CharField(label=_("Description"),
40
40
                                  required=False,
41
 
                                  widget=forms.Textarea)
 
41
                                  widget=forms.Textarea(attrs={'rows': 4}))
42
42
 
43
43
    flavor = forms.ChoiceField(label=_("OpenStack Flavor"))
44
44
 
 
45
    availability_zone = forms.ChoiceField(
 
46
        label=_("Availability Zone"),
 
47
        help_text=_("Launch instances in this availability zone."),
 
48
        required=False,
 
49
        widget=forms.Select(attrs={"class": "availability_zone_field"})
 
50
    )
 
51
 
45
52
    storage = forms.ChoiceField(
46
53
        label=_("Storage location"),
47
54
        help_text=_("Choose a storage location"),
76
83
            workflow_helpers.get_plugin_and_hadoop_version(request))
77
84
        process_choices = []
78
85
        try:
79
 
            version_details = saharaclient.plugin_get_version_details(request,
80
 
                                                            plugin,
81
 
                                                            hadoop_version)
 
86
            version_details = saharaclient.plugin_get_version_details(
 
87
                request, plugin, hadoop_version)
82
88
            for service, processes in version_details.node_processes.items():
83
89
                for process in processes:
84
90
                    process_choices.append(
93
99
            pool_choices.insert(0, (None, "Do not assign floating IPs"))
94
100
 
95
101
            self.fields['floating_ip_pool'] = forms.ChoiceField(
96
 
                label=_("Floating IP pool"),
 
102
                label=_("Floating IP Pool"),
97
103
                choices=pool_choices,
98
104
                required=False)
99
105
 
101
107
            label=_("Auto Security Group"),
102
108
            widget=forms.CheckboxInput(),
103
109
            help_text=_("Create security group for this Node Group."),
104
 
            required=False)
 
110
            required=False,
 
111
            initial=True)
105
112
 
106
113
        groups = network.security_group_list(request)
107
114
        security_group_list = [(sg.id, sg.name) for sg in groups]
138
145
            return nova_utils.sort_flavor_list(request, flavors)
139
146
        return []
140
147
 
 
148
    def populate_availability_zone_choices(self, request, context):
 
149
        # The default is None, i.e. not specifying any availability zone
 
150
        az_list = [(None, _('No availability zone specified'))]
 
151
        az_list.extend([(az.zoneName, az.zoneName)
 
152
                        for az in nova_utils.availability_zone_list(request)
 
153
                        if az.zoneState['available']])
 
154
        return az_list
 
155
 
141
156
    def get_help_text(self):
142
157
        extra = dict()
143
158
        plugin, hadoop_version = (
258
273
                node_configs=configs_dict,
259
274
                floating_ip_pool=context.get("general_floating_ip_pool"),
260
275
                security_groups=context["general_groups"],
261
 
                auto_security_group=context["general_autogroup"])
 
276
                auto_security_group=context["general_autogroup"],
 
277
                availability_zone=context["general_availability_zone"])
262
278
            return True
263
279
        except api_base.APIException as e:
264
280
            self.error_description = str(e)