Ensure that the expiration time for leased IP is updated correctly

Fixes bug 1081664

Change-Id: I77596ef65be817a874fad41b49e7ddbc0663c237
This commit is contained in:
Gary Kotton
2012-11-17 05:51:47 +00:00
parent 6ea6ebe635
commit be77fd3f47

View File

@@ -380,7 +380,8 @@ class QuantumDbPluginV2(quantum_plugin_base_v2.QuantumPluginBaseV2):
def update_fixed_ip_lease_expiration(self, context, network_id,
ip_address, lease_remaining):
expiration = timeutils.utcnow() + datetime.timedelta(lease_remaining)
expiration = (timeutils.utcnow() +
datetime.timedelta(seconds=lease_remaining))
query = context.session.query(models_v2.IPAllocation)
query = query.filter_by(network_id=network_id, ip_address=ip_address)