add new key for bisect way to apply account
use rest-client instead of linux command 'curl'
Signed-off-by: Luan Shengde <shdluan(a)163.com>
---
lib/assign_account_client.rb | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/lib/assign_account_client.rb b/lib/assign_account_client.rb
index d7e0623..15d3f35 100755
--- a/lib/assign_account_client.rb
+++ b/lib/assign_account_client.rb
@@ -7,6 +7,7 @@ require 'json'
require 'mail'
require 'set'
require 'optparse'
+require 'rest-client'
require_relative '../container/defconfig'
require_relative 'es_client'
require_relative '../container/mail-robot/lib/assign-account-email'
@@ -52,7 +53,8 @@ class AutoAssignAccount
apply_info['is_update_account'] = true unless apply_info['my_login_name'].nil?
apply_info['lab'] = LAB
- account_info_str = %x(curl -XGET '#{JUMPER_HOST}:#{JUMPER_PORT}/assign_account' -d '#{apply_info.to_json}')
+ assign_account_url = "#{JUMPER_HOST}:#{JUMPER_PORT}/assign_account"
+ account_info_str = RestClient.post assign_account_url, apply_info.to_json
JSON.parse account_info_str
end
@@ -69,6 +71,7 @@ class AutoAssignAccount
end
def send_mail
+ @my_info['bisect'] = true
message = build_apply_account_email(@my_info)
%x(curl -XPOST "#{SEND_MAIL_HOST}:#{SEND_MAIL_PORT}/send_mail_text" -d "#{message}")
end
@@ -81,3 +84,12 @@ class AutoAssignAccount
send_mail
end
end
+
+my_info = {
+ 'my_email' => 'shdluan(a)163.com',
+ 'my_name' => 'lsd',
+ 'my_commit_url' => ''
+}
+
+test = AutoAssignAccount.new(my_info)
+test.send_account
--
2.23.0