Class: Arver::InfoAction

Inherits:
Action
  • Object
show all
Defined in:
lib/arver/info_action.rb

Instance Attribute Summary

Attributes inherited from Action

#generator, #key, #keystore, #slot_of_target_user, #target_list, #target_user

Instance Method Summary collapse

Methods inherited from Action

#load_key, #needs_target_user?, #new_key_generator, #on_user, #open_keystore, #post_action, #post_host, #post_partition, #pre_action, #pre_partition, #run_on, #verify?, #verify_key_on_target

Constructor Details

#initialize(target_list) ⇒ InfoAction

Returns a new instance of InfoAction.



3
4
5
6
# File 'lib/arver/info_action.rb', line 3

def initialize( target_list )
  super( target_list )
  self.open_keystore
end

Instance Method Details

#execute_partition(partition) ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'lib/arver/info_action.rb', line 12

def execute_partition(partition)
  info = {}
  (caller = Arver::LuksWrapper.dump(partition)).execute
  caller.output.each_line do |line|
    next unless line =~ /^[A-Z].*: .*$/
    info.store(*line.split(':',2).collect{|f| f.strip })
  end
  Arver::Log.info("  #{sprintf("%0-20s",partition.name.first(20))}:  #{sprintf("%0-40s",partition.device_path.first(40))}: Slots: #{(0..7).map{|i| info["Key Slot #{i}"] == 'ENABLED' ? 'X' : '_'}.join}; LUKSv#{info['Version']}; Cypher: #{info['Cipher name']}:#{info['Cipher mode']}:#{info['Hash spec']}; UUID=#{info['UUID']}")
end

#pre_host(host) ⇒ Object



8
9
10
# File 'lib/arver/info_action.rb', line 8

def pre_host( host )
  Arver::Log.info( "\n-- "+host.path+":" )
end