On Wed, Jan 27, 2021 at 08:16:08PM +0800, Liu Yinsi wrote:
before: define my_name, my_email, lab, then store into ES and config yaml after: query my_name, my_email, lab, my_token from ES, then config yaml
[why] store account info into ES, this part will do in other registry service,
which service will do it
so when start auto-submit service, no need to store data, only query ES and config yaml.
what are the benefits of the update?
Signed-off-by: Liu Yinsi liuyinsi@163.com
sbin/auto_submit | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
diff --git a/sbin/auto_submit b/sbin/auto_submit index 5648d59..359a462 100755 --- a/sbin/auto_submit +++ b/sbin/auto_submit @@ -86,15 +86,26 @@ class AutoSubmit end end
-option = {
- my_name: 'Auto Submit Robot',
- my_email: 'autosubmit@localhost',
- lab: `awk '/^lab:\s/ {print $2; exit}' /etc/compass-ci/defaults/*.yaml`.chomp
-} +def query_account_info
- my_email = 'auto-submit@localhost'
the email is fixed? how about define it to a global vars
Thanks, Shenwei
- option = ESQuery.new(index: 'accounts').query_by_id(my_email)
- raise "query auto-submit account info failed: #{my_email}" unless option
- option
+end
+def config_yaml
- option = query_account_info
- build_my_info = BuildMyInfo.new(option['my_email'], option['my_name'], option['lab'], option['my_token'])
- build_my_info.config_default_yaml
- build_my_info.config_lab_yaml
+end
# fix verification problems when submit jobs by auto-submit service -build_my_info = BuildMyInfo.new(option[:my_email], option[:my_name], option[:lab]) -build_my_info.config_my_info +query_account_info +config_yaml
auto_submitter = AutoSubmit.new auto_submitter.listen -- 2.23.0