[PATCH v2 compass-ci] container/mail-robot: fix bugs

fix no file errors: it may throw error if the specified file not exists: Errno::ENOENT: No such file or directory @ rb_sysopen Signed-off-by: Luan Shengde <shdluan@163.com> --- container/mail-robot/lib/apply-account.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/container/mail-robot/lib/apply-account.rb b/container/mail-robot/lib/apply-account.rb index 798546a..d8cb4da 100755 --- a/container/mail-robot/lib/apply-account.rb +++ b/container/mail-robot/lib/apply-account.rb @@ -56,7 +56,7 @@ class ApplyAccount @es_port = ES_PORT # email info file for account issuers. - @account_issuer = YAML.load_file ENV['ACCOUNT_ISSUER'] + @account_issuer = File.exists?(ENV['ACCOUNT_ISSUER']) ? YAML.load_file(ENV['ACCOUNT_ISSUER']) : {} @my_info = {} end -- 2.23.0
participants (1)
-
Luan Shengde