~ubuntu-branches/ubuntu/trusty/horizon/trusty

« back to all changes in this revision

Viewing changes to openstack_dashboard/dashboards/project/instances/workflows/create_instance.py

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-03-31 17:31:49 UTC
  • mfrom: (1.1.38)
  • Revision ID: package-import@ubuntu.com-20140331173149-f28yjk2s8pt15fqj
Tags: 1:2014.1~rc1-0ubuntu1
* New upstream release candidate (LP: #1288245).
  - d/static/*: Refreshed assets for new upstream release.
* d/theme/*: Refresh Ubuntu theme against Icehouse templates (LP: #1291653).

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    availability_zone = forms.ChoiceField(label=_("Availability Zone"),
80
80
                                          required=False)
81
81
 
82
 
    name = forms.CharField(max_length=80, label=_("Instance Name"))
 
82
    name = forms.CharField(label=_("Instance Name"),
 
83
                           max_length=255)
83
84
 
84
85
    flavor = forms.ChoiceField(label=_("Flavor"),
85
86
                               help_text=_("Size of image to launch."))
570
571
                                    help_text=_("Launch instance with "
571
572
                                                "this policy profile"))
572
573
 
 
574
    def __init__(self, request, *args, **kwargs):
 
575
        super(SetNetworkAction, self).__init__(request, *args, **kwargs)
 
576
        network_list = self.fields["network"].choices
 
577
        if len(network_list) == 1:
 
578
            self.fields['network'].initial = [network_list[0][0]]
 
579
 
573
580
    class Meta:
574
581
        name = _("Networking")
575
582
        permissions = ('openstack.services.network',)