Skip to content

Commit a9ad2ff

Browse files
committed
refactor ip_repo
1 parent 9f31e94 commit a9ad2ff

File tree

1 file changed

+4
-4
lines changed
  • src/bosh-director/lib/bosh/director/deployment_plan/ip_provider

1 file changed

+4
-4
lines changed

src/bosh-director/lib/bosh/director/deployment_plan/ip_provider/ip_repo.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ def delete(ip)
1515
ip_address = Bosh::Director::Models::IpAddress.first(address_str: ip_or_cidr.to_cidr_s)
1616

1717
if ip_address
18-
@logger.debug("Releasing ip '#{ip_or_cidr}'")
18+
@logger.debug("Releasing ip '#{ip_or_cidr.to_cidr_s}'")
1919
ip_address.destroy
2020
else
21-
@logger.debug("Skipping releasing ip '#{ip_or_cidr}': not reserved")
21+
@logger.debug("Skipping releasing ip '#{ip_or_cidr.to_cidr_s}': not reserved")
2222
end
2323
end
2424

@@ -71,7 +71,7 @@ def allocate_vip_ip(reservation, subnet)
7171
end
7272

7373
@logger.debug("Allocated vip IP '#{ip_address}' for #{reservation.network.name}")
74-
ip_address.to_i
74+
ip_address
7575
end
7676

7777
private
@@ -84,7 +84,7 @@ def try_to_allocate_dynamic_ip(reservation, subnet)
8484
addresses_in_use = Set.new(all_ip_addresses)
8585

8686
first_range_address = Bosh::Director::IpAddrOrCidr.new(subnet.range.to_range.first.to_i - 1)
87-
87+
8888
addresses_we_cant_allocate = addresses_in_use
8989

9090
addresses_we_cant_allocate.merge(subnet.restricted_ips.map { |int_ip| Bosh::Director::IpAddrOrCidr.new(int_ip)}) unless subnet.restricted_ips.empty?

0 commit comments

Comments
 (0)