diff options
| author | Joe Gordon <jogo@cloudscaling.com> | 2013-02-05 18:12:02 -0800 |
|---|---|---|
| committer | Joe Gordon <jogo@cloudscaling.com> | 2013-02-08 12:15:46 -0800 |
| commit | 6ff32210772a67a1b526d9d784030afc90f3ce99 (patch) | |
| tree | 19532173de03e64507b64c289c2e680b81bb5e26 /nova/db | |
| parent | daddc54befea4414776368b0ae8f689872b21e27 (diff) | |
Use joined version of db.api calls
Replace db.instance_get_active_by_window with
db.instance_get_active_by_window_joined
Remove db.instance_get_active_by_window as it is now unused
When moving over to nova.db.api not returning sqlalchemy
objects non-joined db calls (lazy loaded) won't work.
Partially implements bp db-api-cleanup
Change-Id: Iec647792a049d53862a45f95accd7f46e483aa17
Diffstat (limited to 'nova/db')
| -rw-r--r-- | nova/db/api.py | 11 | ||||
| -rw-r--r-- | nova/db/sqlalchemy/api.py | 19 |
2 files changed, 0 insertions, 30 deletions
diff --git a/nova/db/api.py b/nova/db/api.py index 8d3f0fa4d..ffd153a46 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -606,17 +606,6 @@ def instance_get_all_by_filters(context, filters, sort_key='created_at', marker=marker) -def instance_get_active_by_window(context, begin, end=None, project_id=None, - host=None): - """Get instances active during a certain time window. - - Specifying a project_id will filter for a certain project. - Specifying a host will filter for instances on a given compute host. - """ - return IMPL.instance_get_active_by_window(context, begin, end, - project_id, host) - - def instance_get_active_by_window_joined(context, begin, end=None, project_id=None, host=None): """Get instances and joins active during a certain time window. diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index fb39600c4..74ee6c9e7 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -1656,25 +1656,6 @@ def regex_filter(query, model, filters): return query -@require_context -def instance_get_active_by_window(context, begin, end=None, - project_id=None, host=None): - """Return instances that were active during window.""" - session = get_session() - query = session.query(models.Instance) - - query = query.filter(or_(models.Instance.terminated_at == None, - models.Instance.terminated_at > begin)) - if end: - query = query.filter(models.Instance.launched_at < end) - if project_id: - query = query.filter_by(project_id=project_id) - if host: - query = query.filter_by(host=host) - - return query.all() - - @require_admin_context def instance_get_active_by_window_joined(context, begin, end=None, project_id=None, host=None): |
