key my_uuid is renamed to my_token.
when applying/updating account, will use my_token instead
for this change with no sense
for old user(update account)
keep key my_uuid and add key my_token
for new user
delete my_uuid and just add key my_token
Signed-off-by: Luan Shengde <shdluan(a)163.com>
---
container/assign-account/answerback-email.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/container/assign-account/answerback-email.rb b/container/assign-account/answerback-email.rb
index c08f10e..401bd8c 100755
--- a/container/assign-account/answerback-email.rb
+++ b/container/assign-account/answerback-email.rb
@@ -29,12 +29,13 @@ JUMPER_HOST = defaults['JUMPER_HOST']
JUMPER_PORT = defaults['JUMPER_PORT'] || 29999
SEND_MAIL_HOST = defaults['SEND_MAIL_HOST'] || 'localhost'
SEND_MAIL_PORT = defaults['SEND_MAIL_PORT'] || 49000
+LAB = 'z9'
my_info = {
'my_email' => nil,
'my_name' => nil,
'my_commit_url' => nil,
- 'my_uuid' => nil,
+ 'my_token' => nil,
'my_login_name' => nil,
'my_ssh_pubkey' => []
}
@@ -200,6 +201,7 @@ def build_my_info_from_input(my_info, email_info, my_info_es, stdin_info)
new_stdin_pubkey = stdin_info.delete 'new_ssh_pubkey'
new_pubkey = new_stdin_pubkey || new_email_pubkey
+ my_info['my_token'] = my_info_es['my_uuid'] if my_info['my_token'].nil?
my_info.update my_info_es unless my_info_es.empty?
my_info.update email_info unless email_info.empty?
my_info.update stdin_info unless stdin_info.empty?
@@ -221,7 +223,7 @@ def build_my_info_from_account_info(my_info, account_info, conf_info)
end
def check_server
- return true if ENV['HOSTNAME'] == 'z9'
+ return true if ENV['HOSTNAME'] == LAB
message = 'please run the tool on z9 server'
puts message
@@ -260,7 +262,7 @@ def send_account(my_info, conf_info, email_info, my_info_es, stdin_info)
return unless check_my_email(my_info)
return unless check_email_assigned_account(conf_info, my_info_es)
- my_info['my_uuid'] = %x(uuidgen).chomp unless conf_info['is_update_account']
+ my_info['my_token'] = %x(uuidgen).chomp unless conf_info['is_update_account']
build_my_info_from_input(my_info, email_info, my_info_es, stdin_info)
return unless check_my_name_exist(my_info)
--
2.23.0