summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-03-12 01:39:10 +0000
committerGerrit Code Review <review@openstack.org>2012-03-12 01:39:10 +0000
commit2cc409c6f0ae61b1c1833ce679b603d0369b42e8 (patch)
tree9b8cecfc60d1d7346c1720b7b14af854de162713
parentc87dce824f81d0ecc0455ae6ed8dfd85fb0bc62a (diff)
parent5e7fd2584ad8b20635d284bbe448e45a59c37792 (diff)
Merge "Remove update lockmode from compute_node_get_by_host"
-rw-r--r--nova/db/sqlalchemy/api.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py
index de8e8dad0..e0d6647da 100644
--- a/nova/db/sqlalchemy/api.py
+++ b/nova/db/sqlalchemy/api.py
@@ -518,10 +518,6 @@ def compute_node_update(context, compute_id, values, auto_adjust):
compute_ref.save(session=session)
-# Note: these operations use with_lockmode() ... so this will only work
-# reliably with engines that support row-level locking
-# (postgres, mysql+innodb and above).
-
def compute_node_get_by_host(context, host):
"""Get all capacity entries for the given host."""
session = get_session()
@@ -529,11 +525,14 @@ def compute_node_get_by_host(context, host):
node = session.query(models.ComputeNode).\
options(joinedload('service')).\
filter(models.Service.host == host).\
- filter_by(deleted=False).\
- with_lockmode('update')
+ filter_by(deleted=False)
return node.first()
+# Note: these operations use with_lockmode() ... so this will only work
+# reliably with engines that support row-level locking
+# (postgres, mysql+innodb and above).
+
def compute_node_capacity_find(context, minimum_ram_mb, minimum_disk_gb):
"""Get all enabled hosts with enough ram and disk."""
session = get_session()