Skip to content

Commit

Permalink
LBAASV2 change for horizon - mitaka
Browse files Browse the repository at this point in the history
1. Added provisioning_status, operating_status attributes
   in loadbalancer attributes
2. loadbalancer refs are returned with id attribute in listener
   as per the lbaav2 api document

Change-Id: I2e5283230c97646e13257d808b47f136daf0fd48
Partial-bug: 1599335
  • Loading branch information
ymariappan committed Jul 6, 2016
1 parent 534e7dd commit 7e87fc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ def make_properties(self, lb):
return props

def _get_loadbalancers(self, ll):
loadbalancers = []
lb = {}
lb_refs = ll.get_loadbalancer_refs()
if lb_refs is None:
return None
return [lb_refs[0]['uuid']]
lb['id'] = lb_refs[0]['uuid']
loadbalancers.append(lb)
return loadbalancers

def make_dict(self, ll, fields=None):
props = ll.get_loadbalancer_listener_properties()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class LoadbalancerManager(ResourceManager):
'vip_address': 'vip_address',
'vip_subnet_id': 'vip_subnet_id',
'admin_state': 'admin_state_up',
'provisioning_status': 'provisioning_status',
'operating_status': 'operating_status',
}

@property
Expand Down Expand Up @@ -90,6 +92,8 @@ def make_dict(self, lb, fields=None):
'vip_subnet_id': props.vip_subnet_id,
'vip_address': props.vip_address,
'admin_state_up': props.admin_state,
'provisioning_status': props.provisioning_status,
'operating_status': props.operating_status,
'listeners': self._get_listeners(lb)}

return self._fields(res, fields)
Expand Down Expand Up @@ -200,6 +204,8 @@ def create(self, context, loadbalancer):
obj_uuid, l['vip_subnet_id'], l.get('vip_address'))
lb.set_virtual_machine_interface(vmi)

l['provisioning_status'] = 'ACTIVE'
l['operating_status'] = 'ONLINE'
props = self.make_properties(l)
props.set_vip_address(vip_address)
lb.set_loadbalancer_properties(props)
Expand Down

0 comments on commit 7e87fc9

Please sign in to comment.