~ubuntu-branches/ubuntu/raring/horizon/raring

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2012-05-24 14:33:20 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20120524143320-i7eswfq6ecxlvh5a
Tags: 2012.2~f1-0ubuntu1
* New usptream release. 
* Prepare for quantal:
  - debian/patches/fix-coverage-binary-name.patch: Refreshed.
* Temporarily pass the testsuite.

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
        return shortcuts.redirect('horizon:nova:access_and_security:index')
89
89
 
90
90
 
 
91
def get_instance_info(instance):
 
92
    info_string = _("%(INSTANCE_NAME)s (%(INSTANCE_ID)s)")
 
93
    if instance.instance_id and instance.instance_name:
 
94
        vals = {'INSTANCE_NAME': instance.instance_name,
 
95
                'INSTANCE_ID': instance.instance_id}
 
96
        return info_string % vals
 
97
    return _("Not available")
 
98
 
 
99
 
91
100
def get_instance_link(datum):
92
101
    view = "horizon:nova:instances_and_volumes:instances:detail"
93
102
    if datum.instance_id:
98
107
 
99
108
class FloatingIPsTable(tables.DataTable):
100
109
    ip = tables.Column("ip", verbose_name=_("IP Address"))
101
 
    instance = tables.Column("instance_id",
 
110
    instance = tables.Column(get_instance_info,
102
111
                             link=get_instance_link,
103
112
                             verbose_name=_("Instance"),
104
113
                             empty_value="-")