Merge "Move _delete_port"
This commit is contained in:
commit
946ceac31f
@ -1078,13 +1078,6 @@ class NeutronDbPluginV2(ipam_non_pluggable_backend.IpamNonPluggableBackend,
|
||||
"The port has already been deleted.",
|
||||
port_id)
|
||||
|
||||
def _delete_port(self, context, id):
|
||||
query = (context.session.query(models_v2.Port).
|
||||
enable_eagerloads(False).filter_by(id=id))
|
||||
if not context.is_admin:
|
||||
query = query.filter_by(tenant_id=context.tenant_id)
|
||||
query.delete()
|
||||
|
||||
def get_port(self, context, id, fields=None):
|
||||
port = self._get_port(context, id)
|
||||
return self._make_port_dict(port, fields)
|
||||
|
@ -252,3 +252,10 @@ class IpamBackendMixin(db_base_plugin_common.DbBasePluginCommon):
|
||||
return self.Changes(add=new_ips,
|
||||
original=prev_ips,
|
||||
remove=original_ips)
|
||||
|
||||
def _delete_port(self, context, port_id):
|
||||
query = (context.session.query(models_v2.Port).
|
||||
enable_eagerloads(False).filter_by(id=port_id))
|
||||
if not context.is_admin:
|
||||
query = query.filter_by(tenant_id=context.tenant_id)
|
||||
query.delete()
|
||||
|
Loading…
x
Reference in New Issue
Block a user