~ubuntu-branches/ubuntu/vivid/neutron/vivid-proposed

« back to all changes in this revision

Viewing changes to neutron/plugins/ml2/plugin.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Chuck Short, Corey Byrant
  • Date: 2015-10-15 08:56:04 UTC
  • mfrom: (1.1.25)
  • Revision ID: package-import@ubuntu.com-20151015085604-zmf42dhshxz2qjad
Tags: 1:2015.1.2-0ubuntu1
[ Chuck Short ]
* Resynchronize with stable/kilo (7dbaa12) (LP: #1506058):
  - [7dbaa12] Changed filter field to router_id
  - [6c55f58] Do not log an error when deleting a linuxbridge does not exist
  - [118a76f] metadata: don't crash proxy on non-unicode user data
  - [eec8c50] Only get host data for floating ips on DVR routers
  - [9950ce2] Update dhcp host portbinding on failover
  - [1c87d72] func: Don't use private method of AsyncProcess
  - [834279c] Allow setting Agents description to None
  - [2f85b22] Process user iptables rules before INVALID
  - [f232475] Execute ipset command using check_exit_code
  - [d78899d] Don't write DHCP opts for SLAAC entries
  - [cb0554f] Check idl.run() return value before blocking
  - [2224851] Stop sending gratuitous arp when ip version is 6
  - [96276d5] Fix _ensure_default_security_group logic
  - [66a5116] Remove hack for sending gratuitous arp from fip ns
  - [2394418] populate port security default into network
  - [fc1c812] Remove early yields in _iter_hosts in dhcp agent
  - [2ead51a] Enable servicing lbaasV2 vip by DVR
  - [9498ea2] Descheduling DVR routers when ports are unbound from VM
  - [c74b05e] Bug-Fix for unexpected DHCP agent redundant
  - [e6a0e7d] Switch to dictionary for iptables find
  - [c377330] Add configurable options for HA networks
  - [114949b] Fix ipset can't be destroyed when last rule is deleted
  - [aba5e82] Updated NSXv plugin parameter descriptions
  - [d1a48f7] ovs: don't use ARP responder for IPv6 addresses
  - [4d15b6f] Configure gw_iface for RAs only in Master HA Router
  - [6975b2b] Register extraroute extension
  - [19d5ba4] Broadcast service port's arp in DVR
  - [767cea2] Stop device_owner from being set to 'network:*'
  - [2a6b34e] Fix a wrong condition for the _purge_metering_info function
  - [bf28c72] Add ARP spoofing protection for LinuxBridge agent
  - [635d5cf] Correct neutron-ns-metadata-proxy command when watch_log is
              False
  - [cc791b0] Fix usage of netaddr '.broadcast'
  - [f57a90a] Switch to using os-testr's copy of subunit2html
  - [c1201a2] Add optional file permission argument to replace_file()
  - [533900c] Adding loadbalanacerv2 device owner constant to neutron
              constants
  - [2a00016] Don't fatal error during initialization for missing service
              providers
  - [7c2727c] Update port bindings for master router
  - [6298a90] Setup reference service providers for API test runs
  - [6167d44] Move away nested transaction from _ensure_default_security_group
  - [c129bfa] Reject router-interface-add with a port which doesn't have any
              addresses
  - [770a105] SR-IOV: Fix SR-IOV agent to run ip link commands as root
  - [a0632d7] Catch ObjectDeletedError and skip port or subnet removal
  - [c4c8686] Cleanup stale metadata processes on l3 agent sync
  - [0c22d15] Bump stable/kilo next version to 2015.1.2
  - [4f9409d] lb-agent: ensure tap mtu is the same as physical device
  - [5d38dc5] Adds garp_master_repeat and garp_master_refresh to
              keepalived.conf
  - [e759c1c] Lower log level of errors caused by user requests to INFO
  - [1a1cc3d] Fix race condition by using lock on enable_radvd
  - [5827664] Remove bridge cleanup call
  - [23f5134] Added networking-plumgrid in plugin requirements

[ Corey Byrant ]
* d/rules: Prevent dh_python2 from guessing dependencies.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
 
178
178
    def _get_host_port_if_changed(self, mech_context, attrs):
179
179
        binding = mech_context._binding
180
 
        host = attrs and attrs.get(portbindings.HOST_ID)
181
 
        if (attributes.is_attr_set(host) and binding.host != host):
182
 
            return mech_context.current
 
180
        if attrs and portbindings.HOST_ID in attrs:
 
181
            if binding.host != attrs.get(portbindings.HOST_ID):
 
182
                return mech_context.current
183
183
 
184
184
    def _check_mac_update_allowed(self, orig_port, port, binding):
185
185
        unplugged_types = (portbindings.VIF_TYPE_BINDING_FAILED,
540
540
                              {'res': resource,
541
541
                               'id': obj['result']['id']})
542
542
 
 
543
    @oslo_db_api.wrap_db_retry(max_retries=db_api.MAX_RETRIES,
 
544
                               retry_on_request=True)
543
545
    def _create_bulk_ml2(self, resource, context, request_items):
544
546
        objects = []
545
547
        collection = "%ss" % resource
679
681
        for port in ports:
680
682
            try:
681
683
                self.delete_port(context, port.id)
682
 
            except exc.PortNotFound:
 
684
            except (exc.PortNotFound, sa_exc.ObjectDeletedError):
 
685
                context.session.expunge(port)
683
686
                # concurrent port deletion can be performed by
684
687
                # release_dhcp_port caused by concurrent subnet_delete
685
688
                LOG.info(_LI("Port %s was deleted concurrently"), port.id)
692
695
        for subnet in subnets:
693
696
            try:
694
697
                self.delete_subnet(context, subnet.id)
695
 
            except exc.SubnetNotFound:
 
698
            except (exc.SubnetNotFound, sa_exc.ObjectDeletedError):
 
699
                context.session.expunge(subnet)
696
700
                LOG.info(_LI("Subnet %s was deleted concurrently"),
697
701
                         subnet.id)
698
702
            except Exception:
967
971
 
968
972
        return result, mech_context
969
973
 
 
974
    @oslo_db_api.wrap_db_retry(max_retries=db_api.MAX_RETRIES,
 
975
                               retry_on_request=True)
970
976
    def create_port(self, context, port):
971
977
        attrs = port[attributes.PORT]
972
978
        result, mech_context = self._create_port_db(context, port)
1121
1127
            'context': context,
1122
1128
            'port': new_host_port,
1123
1129
            'mac_address_updated': mac_address_updated,
 
1130
            'original_port': original_port,
1124
1131
        }
1125
1132
        registry.notify(resources.PORT, events.AFTER_UPDATE, self, **kwargs)
1126
1133