Class: Arver::KeyInfoAction
- Defined in:
- lib/arver/key_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
-
#initialize(targets) ⇒ KeyInfoAction
constructor
A new instance of KeyInfoAction.
- #pre_action ⇒ Object
- #pre_host(h) ⇒ Object
- #pre_partition(p) ⇒ Object
Methods inherited from Action
#execute_partition, #load_key, #needs_target_user?, #new_key_generator, #on_user, #open_keystore, #post_action, #post_host, #post_partition, #run_on, #verify?, #verify_key_on_target
Constructor Details
#initialize(targets) ⇒ KeyInfoAction
Returns a new instance of KeyInfoAction.
3 4 5 6 |
# File 'lib/arver/key_info_action.rb', line 3 def initialize(targets) super(targets) self.open_keystore end |
Instance Method Details
#pre_action ⇒ Object
7 8 9 |
# File 'lib/arver/key_info_action.rb', line 7 def pre_action Arver::Log.write( "Listing keys: (+) available (-) not available: " ) end |
#pre_host(h) ⇒ Object
10 11 12 |
# File 'lib/arver/key_info_action.rb', line 10 def pre_host(h) Arver::Log.write( " #{h.name}" ) end |
#pre_partition(p) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/arver/key_info_action.rb', line 13 def pre_partition(p) if keystore.luks_key?(p) line = " +" else line = " -" end versions = keystore.key_versions(p).collect do |v| if v == 0 "0" else Date.strptime(v.to_s,'%s') end end Arver::Log.write( "#{line} #{p.device_path} (#{versions.join(", ")})" ) end |