コード例 #1
0
    def delete_portprofile(self, tenant_id, profile_id):
        """Delete portprofile"""
        LOG.debug("delete_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id, portprofile_id=profile_id)

        plist = cdb.get_pp_binding(tenant_id, profile_id)
        if plist:
            raise cexc.PortProfileInvalidDelete(tenant_id=tenant_id, profile_id=profile_id)
        else:
            cdb.remove_portprofile(tenant_id, profile_id)
コード例 #2
0
    def delete_portprofile(self, tenant_id, profile_id):
        """Delete portprofile"""
        LOG.debug("delete_portprofile() called\n")
        try:
            portprofile = cdb.get_portprofile(tenant_id, profile_id)
        except Exception:
            raise cexc.PortProfileNotFound(tenant_id=tenant_id,
                                           portprofile_id=profile_id)

        plist = cdb.get_pp_binding(tenant_id, profile_id)
        if plist:
            raise cexc.PortProfileInvalidDelete(tenant_id=tenant_id,
                                                profile_id=profile_id)
        else:
            cdb.remove_portprofile(tenant_id, profile_id)
コード例 #3
0
ファイル: test_database.py プロジェクト: BillTheBest/quantum
 def delete_portprofile(self, tenant_id, pp_id):
     """Delete a portprofile"""
     try:
         res = l2network_db.remove_portprofile(tenant_id, pp_id)
         LOG.debug("Deleted port profile : %s" % res.uuid)
         pp_dict = {}
         pp_dict["pp-id"] = str(res.uuid)
         return pp_dict
     except Exception, exc:
         raise Exception("Failed to delete port profile: %s" % str(exc))