diff options
author | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2019-02-28 19:57:34 +0100 |
commit | 62d7990b9bb30cf33ed87017c5c633d1cccc75c2 (patch) | |
tree | c3e1b69c58a412ba1c6f50a0337a23d9f9d6e1a4 /lib/system_check/ldap_check.rb | |
parent | f6453eca992a9c142268e78ac782cef98110d183 (diff) | |
download | gitlab-ce-tc-standard-gem.tar.gz |
Ran standardrb --fix on the whole codebasetc-standard-gem
Inspired by https://twitter.com/searls/status/1101137953743613952 I
decided to try https://github.com/testdouble/standard on our codebase.
It's opinionated, but at least it's a _standard_.
Diffstat (limited to 'lib/system_check/ldap_check.rb')
-rw-r--r-- | lib/system_check/ldap_check.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/system_check/ldap_check.rb b/lib/system_check/ldap_check.rb index 619fb3cccb8..45fd6285829 100644 --- a/lib/system_check/ldap_check.rb +++ b/lib/system_check/ldap_check.rb @@ -3,18 +3,18 @@ module SystemCheck # Used by gitlab:ldap:check rake task class LdapCheck < BaseCheck - set_name 'LDAP:' + set_name "LDAP:" def multi_check if Gitlab::Auth::LDAP::Config.enabled? # Only show up to 100 results because LDAP directories can be very big. # This setting only affects the `rake gitlab:check` script. - limit = ENV['LDAP_CHECK_LIMIT'] + limit = ENV["LDAP_CHECK_LIMIT"] limit = 100 if limit.blank? check_ldap(limit) else - $stdout.puts 'LDAP is disabled in config/gitlab.yml' + $stdout.puts "LDAP is disabled in config/gitlab.yml" end end @@ -32,7 +32,7 @@ module SystemCheck $stdout.puts "LDAP users with access to your GitLab server (only showing the first #{limit} results)" - users = adapter.users(adapter.config.uid, '*', limit) + users = adapter.users(adapter.config.uid, "*", limit) users.each do |user| $stdout.puts "\tDN: #{user.dn}\t #{adapter.config.uid}: #{user.uid}" end @@ -47,12 +47,12 @@ module SystemCheck auth = adapter.config.has_auth? message = if auth && adapter.ldap.bind - 'Success'.color(:green) - elsif auth - 'Failed. Check `bind_dn` and `password` configuration values'.color(:red) - else - 'Anonymous. No `bind_dn` or `password` configured'.color(:yellow) - end + "Success".color(:green) + elsif auth + "Failed. Check `bind_dn` and `password` configuration values".color(:red) + else + "Anonymous. No `bind_dn` or `password` configured".color(:yellow) + end $stdout.puts "LDAP authentication... #{message}" end |