optimize register func
(cherry picked from commit d90e37c22f8b2c73867e67b14d349f870e55ac3a)
This commit is contained in:
parent
66cec228a6
commit
098a7fd263
32
0003-optimize-register-func.patch
Normal file
32
0003-optimize-register-func.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
From e627084922fdead376e16cfc05b555f2d2b114ea Mon Sep 17 00:00:00 2001
|
||||||
|
From: rabbitali <shusheng.wen@outlook.com>
|
||||||
|
Date: Mon, 8 May 2023 11:24:25 +0800
|
||||||
|
Subject: [PATCH] optimize register func
|
||||||
|
|
||||||
|
---
|
||||||
|
ceres/function/command.py | 8 +++-----
|
||||||
|
1 file changed, 3 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ceres/function/command.py b/ceres/function/command.py
|
||||||
|
index d84177e..e9bb25e 100644
|
||||||
|
--- a/ceres/function/command.py
|
||||||
|
+++ b/ceres/function/command.py
|
||||||
|
@@ -47,14 +47,12 @@ def register_on_manager(args: argparse.Namespace) -> NoReturn:
|
||||||
|
Returns:
|
||||||
|
NoReturn
|
||||||
|
"""
|
||||||
|
- if args.data:
|
||||||
|
+ if args.data is not None:
|
||||||
|
register_info = register_info_to_dict(args.data)
|
||||||
|
else:
|
||||||
|
register_info = get_dict_from_file(args.path)
|
||||||
|
- if register_info.get('ceres_host') is not None:
|
||||||
|
- update_ini_data_value(CERES_CONFIG_PATH,
|
||||||
|
- 'ceres', 'port', register_info.get('ceres_host'))
|
||||||
|
- if register(register_info) == SUCCESS:
|
||||||
|
+
|
||||||
|
+ if register_info and register(register_info) == SUCCESS:
|
||||||
|
print('Register Success')
|
||||||
|
else:
|
||||||
|
print('Register Fail')
|
||||||
|
--
|
||||||
@ -1,12 +1,14 @@
|
|||||||
Name: aops-ceres
|
Name: aops-ceres
|
||||||
Version: v1.2.0
|
Version: v1.2.0
|
||||||
Release: 3
|
Release: 4
|
||||||
Summary: An agent which needs to be adopted in client, it managers some plugins, such as gala-gopher(kpi collection), fluentd(log collection) and so on.
|
Summary: An agent which needs to be adopted in client, it managers some plugins, such as gala-gopher(kpi collection), fluentd(log collection) and so on.
|
||||||
License: MulanPSL2
|
License: MulanPSL2
|
||||||
URL: https://gitee.com/openeuler/%{name}
|
URL: https://gitee.com/openeuler/%{name}
|
||||||
Source0: %{name}-%{version}.tar.gz
|
Source0: %{name}-%{version}.tar.gz
|
||||||
Patch0001: 0001-fix-shell-command-return-error-and-update-register-function.patch
|
Patch0001: 0001-fix-shell-command-return-error-and-update-register-function.patch
|
||||||
Patch0002: 0002-fix-hotpatch-fail-show-succeed-bug.patch
|
Patch0002: 0002-fix-hotpatch-fail-show-succeed-bug.patch
|
||||||
|
Patch0003: 0003-optimize-register-func.patch
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: python3-setuptools
|
BuildRequires: python3-setuptools
|
||||||
Requires: python3-requests python3-jsonschema python3-libconf
|
Requires: python3-requests python3-jsonschema python3-libconf
|
||||||
@ -41,6 +43,9 @@ An agent which needs to be adopted in client, it managers some plugins, such as
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu May 11 2023 wenixn<shusheng.wen@outlook.com> - v1.2.0-4
|
||||||
|
- fix hotpatch fail show succeed bug
|
||||||
|
|
||||||
* Tue May 9 2023 ptyang<1475324955@qq.com> - v1.2.0-3
|
* Tue May 9 2023 ptyang<1475324955@qq.com> - v1.2.0-3
|
||||||
- fix hotpatch fail show succeed bug
|
- fix hotpatch fail show succeed bug
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user