summaryrefslogtreecommitdiff
path: root/openstack_dashboard/dashboards/project/floating_ips/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'openstack_dashboard/dashboards/project/floating_ips/forms.py')
-rw-r--r--openstack_dashboard/dashboards/project/floating_ips/forms.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/openstack_dashboard/dashboards/project/floating_ips/forms.py b/openstack_dashboard/dashboards/project/floating_ips/forms.py
index d14de09..bab95fd 100644
--- a/openstack_dashboard/dashboards/project/floating_ips/forms.py
+++ b/openstack_dashboard/dashboards/project/floating_ips/forms.py
@@ -29,6 +29,9 @@ from openstack_dashboard.usage import quotas
29 29
30class FloatingIpAllocate(forms.SelfHandlingForm): 30class FloatingIpAllocate(forms.SelfHandlingForm):
31 pool = forms.ThemableChoiceField(label=_("Pool")) 31 pool = forms.ThemableChoiceField(label=_("Pool"))
32 description = forms.CharField(max_length=255,
33 label=_("Description"),
34 required=False)
32 35
33 def __init__(self, *args, **kwargs): 36 def __init__(self, *args, **kwargs):
34 super(FloatingIpAllocate, self).__init__(*args, **kwargs) 37 super(FloatingIpAllocate, self).__init__(*args, **kwargs)
@@ -46,8 +49,13 @@ class FloatingIpAllocate(forms.SelfHandlingForm):
46 self.api_error(error_message) 49 self.api_error(error_message)
47 return False 50 return False
48 51
49 fip = api.neutron.tenant_floating_ip_allocate(request, 52 param = {}
50 pool=data['pool']) 53 if data['description']:
54 param['description'] = data['description']
55 fip = api.neutron.tenant_floating_ip_allocate(
56 request,
57 pool=data['pool'],
58 **param)
51 messages.success(request, 59 messages.success(request,
52 _('Allocated Floating IP %(ip)s.') 60 _('Allocated Floating IP %(ip)s.')
53 % {"ip": fip.ip}) 61 % {"ip": fip.ip})