Skip to content

Commit

Permalink
Fixed the broken method available_ip_nums in the network model. Looks…
Browse files Browse the repository at this point in the history
… like somebody forgot to refactor this before.
  • Loading branch information
Metallion committed Sep 4, 2012
1 parent 46f83dd commit 19c510a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dcmgr/lib/dcmgr/models/network.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def add_reserved(ipaddr)
end

def available_ip_nums
self.ipv4_ipaddress.hosts.size - self.ip_lease_dataset.count
self.ipv4_ipaddress.hosts.size - self.network_vif_ip_lease_dataset.count
end

def ipv4_u32_dynamic_range_array
Expand Down

2 comments on commit 19c510a

@unakatsuo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it returns wrong available counts for IPs. because network_vif_ip_laeses table contains IPs already released.
This change needs to be reverted.

@saicologic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reverted because self.ip_lease_dateset does not exist.

Please sign in to comment.