Skip to content

Commit

Permalink
fix(cloudstack): Use parsed lease file for virtual router in cloudstack
Browse files Browse the repository at this point in the history
Fixes 5942f40
  • Loading branch information
holmanb committed Jan 3, 2024
1 parent 53eb855 commit cb36bf3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cloudinit/sources/DataSourceCloudStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,18 +281,18 @@ def get_vr_address():
)
return latest_address

# Try dhcp lease files next...
# Try dhcp lease files next
lease_file = dhcp.IscDhclient.get_latest_lease()
if not lease_file:
LOG.debug("No lease file found, using default gateway")
return get_default_gateway()

lease_file = dhcp.IscDhclient.parse_dhcp_server_from_lease_file(lease_file)
if not latest_address:
# No virtual router found, fallback on default gateway
LOG.debug("No DHCP found, using default gateway")
return get_default_gateway()
return latest_address
if lease_file:
latest_address = dhcp.IscDhclient.parse_dhcp_server_from_lease_file(
lease_file
)
if latest_address:
return latest_address

# No virtual router found, fallback to default gateway
LOG.debug("No DHCP found, using default gateway")
return get_default_gateway()


# Used to match classes to dependencies
Expand Down

0 comments on commit cb36bf3

Please sign in to comment.