Sha256: 8c968c34190bfab0f8d3b9786282e428da489415a3b917cd5756f1e8396675d0

Contents?: true

Size: 919 Bytes

Versions: 15

Compression:

Stored size: 919 Bytes

Contents

class OpenStack
  module Compute
    module Formats
      SUMMARY = {
        'id'    => String,
        'name'  => String,
        'links'  => Array
      }
    end
  end
end

def get_flavor_ref
  compute = Fog::Compute[:openstack]
  ENV['OPENSTACK_FLAVOR_REF'] || compute.list_flavors.body['flavors'].first['id']
end

def get_image_ref
  compute = Fog::Compute[:openstack]
  ENV['OPENSTACK_IMAGE_REF'] || compute.list_images.body['images'].first['id']
end

def get_flavor_ref_resize
  # by default we simply add one to the default flavor ref
  ENV['OPENSTACK_FLAVOR_REF_RESIZE'] || (get_flavor_ref.to_i + 1).to_s
end

def set_password_enabled
  pw_enabled = ENV['OPENSTACK_SET_PASSWORD_ENABLED'] || "true"
  return pw_enabled == "true"
end

def get_security_group_ref
  compute = Fog::Compute[:openstack]
  ENV['OPENSTACK_SECURITY_GROUP_REF'] || compute.list_security_groups.body['security_groups'].first['name']
end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/tests/openstack/requests/compute/helper.rb
fog-1.25.0 tests/openstack/requests/compute/helper.rb
nsidc-fog-1.24.1 tests/openstack/requests/compute/helper.rb
fog-1.24.0 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.11 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.10 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.9 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.8 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.7 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.6 tests/openstack/requests/compute/helper.rb
fog-1.23.0 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.4 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.3 tests/openstack/requests/compute/helper.rb
ns-fog-1.22.2 tests/openstack/requests/compute/helper.rb
fog-1.22.1 tests/openstack/requests/compute/helper.rb