~ubuntu-branches/ubuntu/precise/horizon/precise-updates

« back to all changes in this revision

Viewing changes to horizon/dashboards/nova/access_and_security/floating_ips/forms.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-03-09 11:50:22 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20120309115022-ymiww5i58rbg97my
Tags: 2012.1~rc1~20120308.1479-0ubuntu1
* New upstream version.
* debian/rules: Fix symlink when installing horizon.
  (LP: #947118)
* debian/control: Add python-django-nose as a dep. (LP: #944235)
* debian/control: Fix broken depends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 
68
68
 
69
69
class FloatingIpAllocate(forms.SelfHandlingForm):
70
 
    tenant_id = forms.CharField(widget=forms.HiddenInput())
 
70
    tenant_name = forms.CharField(widget=forms.HiddenInput())
71
71
    pool = forms.ChoiceField()
72
72
 
73
73
    def __init__(self, *args, **kwargs):
79
79
        try:
80
80
            fip = api.tenant_floating_ip_allocate(request,
81
81
                                                  pool=data.get('pool', None))
82
 
            LOG.info('Allocating Floating IP "%s" to tenant "%s"'
83
 
                     % (fip.ip, data['tenant_id']))
 
82
            LOG.info('Allocating Floating IP "%s" to project "%s"'
 
83
                     % (fip.ip, data['tenant_name']))
84
84
 
85
85
            messages.success(request,
86
86
                             _('Successfully allocated Floating IP "%(ip)s" \
87
 
                                to tenant "%(tenant)s"')
88
 
                             % {"ip": fip.ip, "tenant": data['tenant_id']})
 
87
                                to project "%(project)s"')
 
88
                             % {"ip": fip.ip, "project": data['tenant_name']})
89
89
        except:
90
90
            exceptions.handle(request, _('Unable to allocate Floating IP.'))
91
91
        return shortcuts.redirect(