On Sun, Nov 01, 2020 at 12:02:52PM +0800, Wu Fengguang wrote:
On Fri, Oct 30, 2020 at 02:56:51PM +0800, Luan Shengde wrote:
- disable use golbal variable apply_info
[why] Style/GlobalVars: Do not introduce global variables. [how] use local variables instead of global variables
- enable transfer user info when execute apply account command
[why] when applying account, the assign-account service will write the user info to user's default config file ~/.config/compass-ci/default/${USER}.yaml
default => defaults
$USER.yaml => account.yaml $USER looks unnecessary complexity. It's already personal config under $HOME, so just use "account.yaml" to express personal info.
I got it.
user info: - my_email - my_name - my_uuid - lab
[how] transfer the user info along with the pub_key to assign-account service
Signed-off-by: Luan Shengde luanshengde2@huawei.com
container/assign-account/answerback-email.rb | 60 ++++++++++++-------- 1 file changed, 35 insertions(+), 25 deletions(-)
diff --git a/container/assign-account/answerback-email.rb b/container/assign-account/answerback-email.rb index bb8e809..4227081 100755 --- a/container/assign-account/answerback-email.rb +++ b/container/assign-account/answerback-email.rb @@ -18,29 +18,31 @@ names = Set.new %w[ JUMPER_PORT SEND_MAIL_HOST_INTERNET SEND_MAIL_PORT_INTERNET
- LAB
]
defaults = relevant_defaults(names)
JUMPER_HOST = defaults['JUMPER_HOST'] || 'api.compass-ci.openeuler.org' JUMPER_PORT = defaults['JUMPER_PORT'] || 29999 -SEND_MAIL_HOST = defaults['SEND_MAIL_HOST_INTERNET'] || 'localhost' -SEND_MAIL_PORT = defaults['SEND_MAIL_PORT_INTERNET'] || 11312 +SEND_MAIL_HOST = defaults['SEND_MAIL_HOST'] || 'localhost' +SEND_MAIL_PORT = defaults['SEND_MAIL_PORT'] || 49000 +LAB = defaults['LAB'] || z9
z9 => 'z9'
- user_info = {
- 'my_email': apply_info['my_email'],
- 'my_name': apply_info['my_name'],
- # for manually assign account, there will be no my_uuid specified
Nope. my_uuid shall always be assigned.
whether need to write the my infos to es for manually assigned users
Thanks Luan Shengde
Thanks, Fengguang