def get_port_from_device(cls, device): """Get port from the brocade specific db.""" # TODO(shh) context is not being passed as # an argument to this function; # # need to be fixed in: # file: neutron/db/securtygroups_rpc_base.py # function: securitygroup_rules_for_devices() # which needs to pass context to us # Doing what other plugins are doing session = db.get_session() port = brocade_db.get_port_from_device( session, device[len(n_const.TAP_DEVICE_PREFIX):]) # TODO(shiv): need to extend the db model to include device owners # make it appears that the device owner is of type network if port: port['device'] = device port['device_owner'] = AGENT_OWNER_PREFIX port['binding:vif_type'] = 'bridge' return port
def get_port_from_device(cls, device): """Get port from the brocade specific db.""" # TODO(shh) context is not being passed as # an argument to this function; # # need to be fixed in: # file: neutron/db/securtygroups_rpc_base.py # function: securitygroup_rules_for_devices() # which needs to pass context to us # Doing what other plugins are doing session = db.get_session() port = brocade_db.get_port_from_device( session, device[len(q_const.TAP_DEVICE_PREFIX):]) # TODO(shiv): need to extend the db model to include device owners # make it appears that the device owner is of type network if port: port['device'] = device port['device_owner'] = AGENT_OWNER_PREFIX port['binding:vif_type'] = 'bridge' return port