A-Tune/backport-atune-bugfix-atune-adm-check-error-before-atune-adm-profile.patch

36 lines
1.1 KiB
Diff

From 44588c0b01eb915e43366489a78dfc3ae9a4f9f8 Mon Sep 17 00:00:00 2001
From: EnboKang <kangenbo@huawei.com>
Date: Wed, 23 Sep 2020 16:25:03 +0800
Subject: [PATCH] bugfix: atune-adm check error before atune-adm profile
---
modules/client/profile/profile_check.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/client/profile/profile_check.go b/modules/client/profile/profile_check.go
index 319055b..e05ab4d 100644
--- a/modules/client/profile/profile_check.go
+++ b/modules/client/profile/profile_check.go
@@ -16,6 +16,7 @@ package profile
import (
"fmt"
PB "gitee.com/openeuler/A-Tune/api/profile"
+ "strings"
"gitee.com/openeuler/A-Tune/common/client"
SVC "gitee.com/openeuler/A-Tune/common/service"
"gitee.com/openeuler/A-Tune/common/utils"
@@ -97,6 +98,10 @@ func profileCheck(ctx *cli.Context) error {
}
if err != nil {
+ if strings.Contains(err.Error(), "no active profile or more than 1 active profile") {
+ fmt.Println("no active profile or more than 1 active profile")
+ break
+ }
return err
}
utils.Print(reply)
--
1.8.3.1