"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "manila/share/drivers/service_instance.py" between
manila-8.1.2.tar.gz and manila-8.1.3.tar.gz

About: OpenStack Manila provides “Shared Filesystems as a service”.
The "Stein" series (maintained release).

service_instance.py  (manila-8.1.2):service_instance.py  (manila-8.1.3)
skipping to change at line 833 skipping to change at line 833
try: try:
self.neutron_api.delete_port(port_id) self.neutron_api.delete_port(port_id)
except exception.NetworkException as e: except exception.NetworkException as e:
if e.kwargs.get('code') != 404: if e.kwargs.get('code') != 404:
raise raise
LOG.debug("Failed to delete port %(port_id)s with error: " LOG.debug("Failed to delete port %(port_id)s with error: "
"\n %(exc)s", {"port_id": port_id, "exc": e}) "\n %(exc)s", {"port_id": port_id, "exc": e})
if router_id and subnet_id: if router_id and subnet_id:
ports = self.neutron_api.list_ports( ports = self.neutron_api.list_ports(
fields=['fixed_ips', 'device_id', 'device_owner']) fields=['device_id', 'device_owner'],
fixed_ips=['subnet_id=%s' % subnet_id])
# NOTE(vponomaryov): iterate ports to get to know whether current # NOTE(vponomaryov): iterate ports to get to know whether current
# subnet is used or not. We will not remove it from router if it # subnet is used or not. We will not remove it from router if it
# is used. # is used.
for port in ports: for port in ports:
# NOTE(vponomaryov): if device_id is present, then we know that # NOTE(vponomaryov): if device_id is present, then we know that
# this port is used. Also, if device owner is 'compute:*', then # this port is used. Also, if device owner is 'compute:*', then
# we know that it is VM. We continue only if both are 'True'. # we know that it is VM. We continue only if both are 'True'.
if (port['device_id'] and if (port['device_id'] and
port['device_owner'].startswith('compute:')): port['device_owner'].startswith('compute:')):
for fixed_ip in port['fixed_ips']: # NOTE(vponomaryov): There are other share servers
if fixed_ip['subnet_id'] == subnet_id: # exist that use this subnet. So, do not remove it
# NOTE(vponomaryov): There are other share servers # from router.
# exist that use this subnet. So, do not remove it return
# from router.
return
try: try:
# NOTE(vponomaryov): there is no other share servers or # NOTE(vponomaryov): there is no other share servers or
# some VMs that use this subnet. So, remove it from router. # some VMs that use this subnet. So, remove it from router.
self.neutron_api.router_remove_interface( self.neutron_api.router_remove_interface(
router_id, subnet_id) router_id, subnet_id)
except exception.NetworkException as e: except exception.NetworkException as e:
if e.kwargs['code'] != 404: if e.kwargs['code'] != 404:
raise raise
LOG.debug('Subnet %(subnet_id)s is not attached to the ' LOG.debug('Subnet %(subnet_id)s is not attached to the '
'router %(router_id)s.', 'router %(router_id)s.',
 End of changes. 2 change blocks. 
7 lines changed or deleted 6 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)