def create_port_precommit(self, mech_context): """Create logical port on the switch (db update).""" LOG.debug("create_port_precommit: called") port = mech_context.current port_id = port['id'] network_id = port['network_id'] tenant_id = port['tenant_id'] admin_state_up = port['admin_state_up'] context = mech_context._plugin_context network = brocade_db.get_network(context, network_id) vlan_id = network['vlan'] try: brocade_db.create_port(context, port_id, network_id, None, vlan_id, tenant_id, admin_state_up) except Exception: LOG.exception(_LE("Brocade Mechanism: failed to create port" " in db")) raise Exception( _("Brocade Mechanism: create_port_precommit failed"))
def create_port_precommit(self, mech_context): """Create logical port on the switch (db update).""" LOG.debug("create_port_precommit: called") port = mech_context.current port_id = port['id'] network_id = port['network_id'] tenant_id = port['tenant_id'] admin_state_up = port['admin_state_up'] context = mech_context._plugin_context network = brocade_db.get_network(context, network_id) vlan_id = network['vlan'] try: brocade_db.create_port(context, port_id, network_id, None, vlan_id, tenant_id, admin_state_up) except Exception: LOG.exception( _LE("Brocade Mechanism: failed to create port" " in db")) raise Exception( _("Brocade Mechanism: create_port_precommit failed"))