Exemplo n.º 1
0
def check_update_port(orig, new):
    device_owner = new['device_owner']
    # REVISIT(yamamoto): The empty device_owner is allowed here because
    # it's assumed by many of unit tests and tempest.
    if (new['fixed_ips'] != orig['fixed_ips'] and
        not (device_owner.startswith(n_const.DEVICE_OWNER_COMPUTE_PREFIX) or
             device_owner.startswith(n_const.DEVICE_OWNER_ROUTER_INTF) or
             device_owner == '')):
        raise n_exc.UnsupportedPortDeviceOwner(op='fixed_ips update',
                                               port_id=new['id'],
                                               device_owner=device_owner)
Exemplo n.º 2
0
 def _check_mac_addr_update(self, context, port, new_mac, device_owner):
     if (device_owner and device_owner.startswith('network:')):
         raise n_exc.UnsupportedPortDeviceOwner(op=_("mac address update"),
                                                port_id=id,
                                                device_owner=device_owner)