Class: KeypairStatus
- Inherits:
-
Object
- Object
- KeypairStatus
- Defined in:
- lib/danarchy_sys/cli/keypair_manager/keypair_status.rb
Class Method Summary collapse
Class Method Details
.all_keypairs(os_compute) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/danarchy_sys/cli/keypair_manager/keypair_status.rb', line 3 def self.all_keypairs(os_compute) keypairs = os_compute.keypairs.all_keypairs keypairs.each do |keypair| single_keypair(keypair) puts '' end end |
.single_keypair(keypair) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/danarchy_sys/cli/keypair_manager/keypair_status.rb', line 13 def self.single_keypair(keypair) istats = { 'Name' => keypair.name, 'Fingerprint' => keypair.fingerprint, 'Public Key' => keypair.public_key, } format = "%#{istats.keys.max.size + 2}s" istats.each do |k, v| printf("#{format} %0s\n", "#{k}:", v) end end |