Class: Conjur::Command::LDAPSync

Inherits:
Conjur::Command show all
Defined in:
lib/conjur/command/ldapsync.rb

Constant Summary collapse

LIST_FORMATS =
%w(pretty json)

Class Method Summary collapse

Methods inherited from Conjur::Command

acting_as_option, annotate_option, api, api=, assert_empty, collection_option, command, command_impl_for_list, command_options_for_list, context_option, current_role, current_user, destination_role, display, display_members, elevated?, give_away_resource, has_admin?, hide_docs, highline, integer?, interactive_option, method_missing, min_version, notify_deprecated, prompt_for_annotations, prompt_for_group, prompt_for_id, prompt_for_idnumber, prompt_for_password, prompt_for_public_key, prompt_to_confirm, read_till_eof, require_arg, retire_internal_role, retire_options, retire_resource, retire_role, validate_privileges, validate_public_key, validate_retire_privileges

Methods included from IdentifierManipulation

#conjur_account, #full_resource_id, #get_kind_and_id_from_args

Class Method Details

.error_messages(resp) ⇒ Object



7
8
9
# File 'lib/conjur/command/ldapsync.rb', line 7

def self.error_messages(resp)
  resp['events'].collect {|e| e['message'] if e['severity'] == 'error'}.compact
end

.show_messages(resp) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/conjur/command/ldapsync.rb', line 11

def self.show_messages(resp)
  msgs = resp['events'].each_with_object([]) do |e, arr|
    if e['severity'] == 'warn' || e['severity'] == 'error'
      arr << "\n#{e['severity'].upcase}: #{e['message']}"
    end
  end
  $stderr.puts(msgs.join("\n") + "\n\n") unless msgs.empty?
end