Esempio n. 1
0
 def update_group(self, tenant, region_name, group_id, group_name):
     if not group_id or group_id < 0:
         return 400, u"组ID不合法", None
     if not group_name:
         return 400, u"组名不能为空", None
     group = group_repo.get_group_by_unique_key(tenant.tenant_id, region_name, group_name)
     if group:
         return 403, u"组名{0}已存在".format(group_name), None
     group_repo.update_group_name(group_id, group_name)
     return 200, u"修改成功", group_name
Esempio n. 2
0
 def update_group(self,
                  tenant,
                  region_name,
                  group_id,
                  group_name,
                  group_note=""):
     if not group_id or group_id < 0:
         raise ServiceHandleException(msg="app id illegal",
                                      msg_show="应用ID不合法")
     self.check_group_name(tenant, region_name, group_name)
     group = group_repo.get_group_by_unique_key(tenant.tenant_id,
                                                region_name, group_name)
     if group and group.ID != group_id:
         raise ServiceHandleException(
             msg="app already exists",
             msg_show="应用名{0}已存在".format(group_name))
     group_repo.update_group_name(group_id, group_name, group_note)