diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-11-28 15:27:57 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-11-28 15:27:57 +0000 |
| commit | e2c0174a76b7cdc9471a35a8a5d26cc6479b13e2 (patch) | |
| tree | 6ad9f308831c1a7b172e0a0d8665cddf3b024dd1 /nova/db | |
| parent | b424512f9f5a7b74103b68c21a48f2ad6b9aa79e (diff) | |
| parent | 8a3c7d30914c7cd1f85583316980ece3c33ed3d1 (diff) | |
Merge "Make resize and multi-node work properly together"
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/api.py | 8 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 9 |
2 files changed, 10 insertions, 7 deletions
diff --git a/nova/db/api.py b/nova/db/api.py index ebad6ffae..b496e4bd0 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -404,11 +404,11 @@ def migration_get_unconfirmed_by_dest_compute(context, confirm_window, confirm_window, dest_compute) -def migration_get_in_progress_by_host(context, host): - """Finds all migrations for the given host that are not yet confirmed or - reverted. +def migration_get_in_progress_by_host_and_node(context, host, node): + """Finds all migrations for the given host + node that are not yet + confirmed or reverted. """ - return IMPL.migration_get_in_progress_by_host(context, host) + return IMPL.migration_get_in_progress_by_host_and_node(context, host, node) #################### diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 96666079a..cf5561d8b 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -3394,11 +3394,14 @@ def migration_get_unconfirmed_by_dest_compute(context, confirm_window, @require_admin_context -def migration_get_in_progress_by_host(context, host, session=None): +def migration_get_in_progress_by_host_and_node(context, host, node, + session=None): return model_query(context, models.Migration, session=session).\ - filter(or_(models.Migration.source_compute == host, - models.Migration.dest_compute == host)).\ + filter(or_(and_(models.Migration.source_compute == host, + models.Migration.source_node == node), + and_(models.Migration.dest_compute == host, + models.Migration.dest_node == node))).\ filter(~models.Migration.status.in_(['confirmed', 'reverted'])).\ options(joinedload('instance')).\ all() |
