Skip to content

Commit a16d61a

Browse files
author
Himani Anil Deshpande
committed
Stream line condition
1 parent 38a7f13 commit a16d61a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cookbooks/aws-parallelcluster-environment/libraries/directory_service_utils.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@ def parse_arn(arn_string)
2121
def _get_cn_subparam(param)
2222
tokens = param.split(",") unless param.blank?
2323
tokens.each do |token|
24-
['cn=', 'CN='].each do |param_search|
25-
Chef::Log.info("Token is #{token} and param search is #{param_search} and condition #{token.include? param_search}")
26-
return token if token.include? param_search
27-
end
24+
Chef::Log.info("Token is #{token} and condition #{token.downcase.start_with? "cn="}")
25+
return token if token.downcase.start_with? "cn"
2826
end
2927
""
3028
end

0 commit comments

Comments
 (0)