@@ -148,6 +148,7 @@ def get_api_engine():
148
148
PER_PROJECT_QUOTAS = ['fixed_ips' , 'floating_ips' , 'networks' ]
149
149
150
150
151
+ # NOTE(stephenfin): This is required and used by oslo.db
151
152
def get_backend ():
152
153
"""The backend is this module itself."""
153
154
return sys .modules [__name__ ]
@@ -963,15 +964,6 @@ def floating_ip_create(context, values):
963
964
return floating_ip_ref
964
965
965
966
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
-
975
967
@require_context
976
968
@oslo_db_api .wrap_db_retry (max_retries = 5 , retry_on_deadlock = True )
977
969
@pick_context_manager_writer
@@ -1507,16 +1499,6 @@ def fixed_ip_update(context, address, values):
1507
1499
_fixed_ip_get_by_address (context , address ).update (values )
1508
1500
1509
1501
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
-
1520
1502
###################
1521
1503
1522
1504
@@ -4086,14 +4068,6 @@ def security_group_destroy(context, security_group_id):
4086
4068
soft_delete ()
4087
4069
4088
4070
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
-
4097
4071
###################
4098
4072
4099
4073
0 commit comments