|
24 | 24 | from networking_generic_switch import config as gsw_conf |
25 | 25 | from networking_generic_switch import devices |
26 | 26 | from networking_generic_switch.devices import utils as device_utils |
27 | | -from networking_generic_switch import exceptions as ngs_exc |
28 | 27 |
|
29 | 28 | LOG = logging.getLogger(__name__) |
30 | 29 |
|
@@ -372,35 +371,15 @@ def update_port_postcommit(self, context): |
372 | 371 |
|
373 | 372 | # If segmentation ID is None, set vlan 1 |
374 | 373 | segmentation_id = segment.get(api.SEGMENTATION_ID) or 1 |
375 | | - trunk_details = port.get('trunk_details', {}) |
376 | 374 | LOG.debug("Putting switch port %(switch_port)s on " |
377 | 375 | "%(switch_info)s in vlan %(segmentation_id)s", |
378 | 376 | {'switch_port': port_id, 'switch_info': switch_info, |
379 | 377 | 'segmentation_id': segmentation_id}) |
380 | 378 | # Move port to network |
381 | | - try: |
382 | | - if trunk_details: |
383 | | - vtr = self._is_vlan_translation_required(trunk_details) |
384 | | - switch.plug_port_to_network_trunk( |
385 | | - port_id, segmentation_id, trunk_details, vtr) |
386 | | - elif is_802_3ad: |
387 | | - switch.plug_bond_to_network(port_id, segmentation_id) |
388 | | - else: |
389 | | - switch.plug_port_to_network(port_id, segmentation_id) |
390 | | - except ngs_exc.GenericSwitchNotSupported as e: |
391 | | - LOG.warning("Operation is not supported by " |
392 | | - "networking-generic-switch. %(err)s)", |
393 | | - {'err': e}) |
394 | | - raise e |
395 | | - except Exception as e: |
396 | | - LOG.error("Failed to plug port %(port_id)s in " |
397 | | - "segment %(segment_id)s on device " |
398 | | - "%(device)s due to error %(err)s", |
399 | | - {'port_id': port['id'], |
400 | | - 'device': switch_info, |
401 | | - 'segment_id': segmentation_id, |
402 | | - 'err': e}) |
403 | | - raise e |
| 379 | + if is_802_3ad: |
| 380 | + switch.plug_bond_to_network(port_id, segmentation_id) |
| 381 | + else: |
| 382 | + switch.plug_port_to_network(port_id, segmentation_id) |
404 | 383 | LOG.info("Successfully plugged port %(port_id)s in segment " |
405 | 384 | "%(segment_id)s on device %(device)s", |
406 | 385 | {'port_id': port['id'], 'device': switch_info, |
@@ -445,14 +424,6 @@ def delete_port_postcommit(self, context): |
445 | 424 | if self._is_port_bound(port): |
446 | 425 | self._unplug_port_from_segment(port, context.top_bound_segment) |
447 | 426 |
|
448 | | - def _is_vlan_translation_required(self, trunk_details): |
449 | | - """Check if vlan translation is required to configure specific trunk. |
450 | | -
|
451 | | - :returns: True if vlan translation is required, False otherwise. |
452 | | - """ |
453 | | - # FIXME: removed for simplicity |
454 | | - return False |
455 | | - |
456 | 427 | def bind_port(self, context): |
457 | 428 | """Attempt to bind a port. |
458 | 429 |
|
|
0 commit comments