Skip to content

Commit 03322bb

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "trivial: Remove dead nova.db functions"
2 parents 19c516e + b944b1a commit 03322bb

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

nova/db/sqlalchemy/api.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ def get_api_engine():
148148
PER_PROJECT_QUOTAS = ['fixed_ips', 'floating_ips', 'networks']
149149

150150

151+
# NOTE(stephenfin): This is required and used by oslo.db
151152
def get_backend():
152153
"""The backend is this module itself."""
153154
return sys.modules[__name__]
@@ -963,15 +964,6 @@ def floating_ip_create(context, values):
963964
return floating_ip_ref
964965

965966

966-
def _floating_ip_count_by_project(context, project_id):
967-
nova.context.authorize_project_context(context, project_id)
968-
# TODO(tr3buchet): why leave auto_assigned floating IPs out?
969-
return model_query(context, models.FloatingIp, read_deleted="no").\
970-
filter_by(project_id=project_id).\
971-
filter_by(auto_assigned=False).\
972-
count()
973-
974-
975967
@require_context
976968
@oslo_db_api.wrap_db_retry(max_retries=5, retry_on_deadlock=True)
977969
@pick_context_manager_writer
@@ -1507,16 +1499,6 @@ def fixed_ip_update(context, address, values):
15071499
_fixed_ip_get_by_address(context, address).update(values)
15081500

15091501

1510-
def _fixed_ip_count_by_project(context, project_id):
1511-
nova.context.authorize_project_context(context, project_id)
1512-
return model_query(context, models.FixedIp, (models.FixedIp.id,),
1513-
read_deleted="no").\
1514-
join((models.Instance,
1515-
models.Instance.uuid == models.FixedIp.instance_uuid)).\
1516-
filter(models.Instance.project_id == project_id).\
1517-
count()
1518-
1519-
15201502
###################
15211503

15221504

@@ -4086,14 +4068,6 @@ def security_group_destroy(context, security_group_id):
40864068
soft_delete()
40874069

40884070

4089-
def _security_group_count_by_project_and_user(context, project_id, user_id):
4090-
nova.context.authorize_project_context(context, project_id)
4091-
return model_query(context, models.SecurityGroup, read_deleted="no").\
4092-
filter_by(project_id=project_id).\
4093-
filter_by(user_id=user_id).\
4094-
count()
4095-
4096-
40974071
###################
40984072

40994073

0 commit comments

Comments
 (0)