예제 #1
0
    def associate_portprofile(self, tenant_id, net_id, port_id, portprofile_id):
        """Associate port profile"""
        LOG.debug("associate_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, portprofile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=portprofile_id)

        cdb.add_pp_binding(tenant_id, port_id, portprofile_id, False)
예제 #2
0
    def associate_portprofile(self, tenant_id, net_id,
                              port_id, portprofile_id):
        """Associate port profile"""
        LOG.debug("associate_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, portprofile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=portprofile_id)

        cdb.add_pp_binding(tenant_id, port_id, portprofile_id, False)
예제 #3
0
 def create_pp_binding(self, tenant_id, port_id, pp_id, default):
     """Add a portprofile binding"""
     ppbinding_dict = {}
     try:
         res = l2network_db.add_pp_binding(tenant_id, port_id, pp_id,
                                                             default)
         LOG.debug("Created port profile binding: %s" % res.portprofile_id)
         ppbinding_dict["portprofile-id"] = str(res.portprofile_id)
         ppbinding_dict["port-id"] = str(res.port_id)
         ppbinding_dict["tenant-id"] = res.tenant_id
         ppbinding_dict["default"] = res.default
         return ppbinding_dict
     except Exception, exc:
         LOG.error("Failed to create port profile binding: %s" % str(exc))