Sha256: e27150258dd8601133551b61566621db1f2fc522021f7f74c83020a67e16bc21
Contents?: true
Size: 655 Bytes
Versions: 13
Compression:
Stored size: 655 Bytes
Contents
require 'fog/core/collection' require 'fog/openstack/models/compute/key_pair' module Fog module Compute class OpenStack class KeyPairs < Fog::Collection model Fog::Compute::OpenStack::KeyPair def all items = Array.new connection.list_key_pairs.body['keypairs'].each do |kp| items = items + kp.values end load(items) end def get(key_pair_name) if key_pair_name self.all.select {|kp| kp.name == key_pair_name}.first end rescue Fog::Compute::OpenStack::NotFound nil end end end end end
Version data entries
13 entries across 13 versions & 7 rubygems