예제 #1
0
 def rename_portprofile(self, tenant_id, profile_id, new_name):
     """Rename port profile"""
     LOG.debug("rename_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)
     portprofile = cdb.update_portprofile(tenant_id, profile_id, new_name)
     new_pp = cutil.make_portprofile_dict(
         tenant_id, portprofile[const.UUID], portprofile[const.PPNAME], portprofile[const.PPQOS]
     )
     return new_pp
예제 #2
0
 def update_portprofile(self, tenant_id, pp_id, name, vlan_id, qos):
     """Update a portprofile"""
     try:
         res = l2network_db.update_portprofile(tenant_id, pp_id, name,
                                               vlan_id, qos)
         LOG.debug("Updating port profile : %s" % res.uuid)
         pp_dict = {}
         pp_dict["portprofile-id"] = str(res.uuid)
         pp_dict["portprofile-name"] = res.name
         pp_dict["vlan-id"] = str(res.vlan_id)
         pp_dict["qos"] = res.qos
         return pp_dict
     except Exception, exc:
         raise Exception("Failed to update port profile: %s" % str(exc))
예제 #3
0
 def rename_portprofile(self, tenant_id, profile_id, new_name):
     """Rename port profile"""
     LOG.debug("rename_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)
     portprofile = cdb.update_portprofile(tenant_id, profile_id, new_name)
     new_pp = cutil.make_portprofile_dict(tenant_id,
                                          portprofile[const.UUID],
                                          portprofile[const.PPNAME],
                                          portprofile[const.PPQOS])
     return new_pp