def _validate_subports_not_trunk_net(self, context, trunk_port,
                                      trunk_subports):
     """Validates if a subport is not in the trunk network"""
     neutron_subports = [
         self.core_plugin.get_port(context, port['port_id'])
         for port in trunk_subports
     ]
     bad_port = next((port for port in neutron_subports
                      if port['network_id'] == trunk_port['network_id']),
                     None)
     if bad_port:
         raise nuage_exc.SubPortParentPortConflict(subport=bad_port['id'])
Example #2
0
 def _validate_subports_not_trunk_net(self, trunk_port, trunk_subports):
     """Validates if a subport is not in the trunk network"""
     bad_port = next((port for port in trunk_subports
                      if port.network_id == trunk_port['network_id']), None)
     if bad_port:
         raise nuage_exc.SubPortParentPortConflict(subport=bad_port.id)