Skip to content

Commit

Permalink
Extra properties in lease detailed get
Browse files Browse the repository at this point in the history
Change-Id: I936a515410075b793c5addf0139cfb130d99a96a
  • Loading branch information
AnishReddyRavula committed Apr 15, 2024
1 parent bae6933 commit acb1053
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions blazar/manager/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,13 +322,28 @@ def get_lease(self, lease_id):
return db_api.lease_get(lease_id)

def hosts_in_lease(self, lease_id):
return db_api.hosts_in_lease(lease_id)
hosts = db_api.hosts_in_lease(lease_id)
for host in hosts:
extra_capabilities = self.plugins[r['resource_type']]._get_extra_capabilities(host['id'])
if host is not None and extra_capabilities:
host.update(extra_capabilities)
return hosts

def networks_in_lease(self, lease_id):
return db_api.networks_in_lease(lease_id)
networks = db_api.networks_in_lease(lease_id)
for network in networks:
extra_capabilities = self.plugins[r['resource_type']]._get_extra_capabilities(network['id'])
if network is not None and extra_capabilities:
network.update(extra_capabilities)
return networks

def devices_in_lease(self, lease_id):
return db_api.devices_in_lease(lease_id)
devices = db_api.devices_in_lease(lease_id)
for device in devices:
extra_capabilities = self.plugins[r['resource_type']]._get_extra_capabilities(device['id'])
if device is not None and extra_capabilities:
device.update(extra_capabilities)
return devices

def list_leases(self, project_id=None, query=None):
return db_api.lease_list(project_id)
Expand Down

0 comments on commit acb1053

Please sign in to comment.