[PATCH v3 compass-ci] lib/job.cr: enable the account check function

Signed-off-by: Wu Zhende <wuzhende666@163.com> --- src/lib/job.cr | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib/job.cr b/src/lib/job.cr index 03ca5af..305984c 100644 --- a/src/lib/job.cr +++ b/src/lib/job.cr @@ -392,15 +392,16 @@ class Job private def check_account_info error_msg = "Failed to verify the account.\n" error_msg += "Please refer to https://gitee.com/wu_fengguang/compass-ci/blob/master/doc/manual/apply-accou..." + account_info = @es.get_account(self["my_email"]) - # raise account_info unless account_info.is_a?(JSON::Any) + raise error_msg unless account_info.is_a?(JSON::Any) - # @account_info = account_info.as_h - @account_info = account_info.as_h if account_info.is_a?(JSON::Any) + @account_info = account_info.as_h - # raise error_msg if @account_info["found"]? == false - # raise error_msg unless self["my_name"] == @account_info["my_name"].to_s - # raise error_msg unless self["my_token"] == @account_info["my_token"] + # my_name can be nil in es + # my_token can't be nil in es + raise error_msg unless self["my_name"] == @account_info["my_name"]?.to_s + raise error_msg unless self["my_token"] == @account_info["my_token"]? @hash.delete("my_uuid") @hash.delete("my_token") -- 2.23.0
participants (1)
-
Wu Zhende