components/openstack/horizon/patches/18.fix-instances-table.patch
changeset 6856 356aeea98c39
parent 6855 ea44e7e0ca98
child 6857 4cbe0ba20818
equal deleted inserted replaced
6855:ea44e7e0ca98 6856:356aeea98c39
     1 This patch has been integrated into Liberty but has not yet been
       
     2 back-ported to Kilo.
       
     3 
       
     4 commit c8b597f91250300fe28ce55990638f81b316e77d
       
     5 Author: Masco Kaliyamoorthy <[email protected]>
       
     6 Date:   Tue Apr 7 16:06:18 2015 +0530
       
     7 
       
     8     hide disassociate floating ip when no ip attached
       
     9 
       
    10     hide the disassociate floating ip action,
       
    11     when the instance is not attached with any floating ip.
       
    12 
       
    13     Change-Id: Ifdb8aefcbc1791614c5d943e5081ac1efdd7acd6
       
    14     Closes-Bug: #1441088
       
    15 
       
    16 --- horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/tables.py.orig	2016-04-12 08:16:23.384881401 -0700
       
    17 +++ horizon-2015.1.2/openstack_dashboard/dashboards/project/instances/tables.py	2016-04-12 08:16:42.245770950 -0700
       
    18 @@ -620,7 +620,11 @@ class SimpleDisassociateIP(policy.Policy
       
    19              return False
       
    20          if not conf.HORIZON_CONFIG["simple_ip_management"]:
       
    21              return False
       
    22 -        return not is_deleting(instance)
       
    23 +        for addresses in instance.addresses.values():
       
    24 +            for address in addresses:
       
    25 +                if address.get('OS-EXT-IPS:type') == "floating":
       
    26 +                    return not is_deleting(instance)
       
    27 +        return False
       
    28  
       
    29      def single(self, table, request, instance_id):
       
    30          try: