Sha256: d4ceb2e6a6522ae845d3ad4f51c2707d5ba039988687bb1fb3dad6d47c7d5d3f

Contents?: true

Size: 958 Bytes

Versions: 22

Compression:

Stored size: 958 Bytes

Contents

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

def compute
  Fog::Compute[:openstack]
end

def get_flavor_ref
  ENV['OPENSTACK_FLAVOR_REF'] || compute.list_flavors.body['flavors'].first['id']
end

def get_image_ref
  ENV['OPENSTACK_IMAGE_REF'] || compute.list_images.body['images'].first['id']
end

def get_volume_ref
  ENV['OPENSTACK_VOLUME_REF'] || compute.list_volumes.body['volumes'].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
  ENV['OPENSTACK_SECURITY_GROUP_REF'] || compute.list_security_groups.body['security_groups'].first['name']
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
fog-openstack-0.1.7 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.6 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.5 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.4 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.3 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.2 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.1 tests/openstack/requests/compute/helper.rb
fog-openstack-0.1.0 tests/openstack/requests/compute/helper.rb
fog-1.37.0 tests/openstack/requests/compute/helper.rb
fog-1.36.0 tests/openstack/requests/compute/helper.rb
fog-1.35.0 tests/openstack/requests/compute/helper.rb
fog-2.0.0.pre.0 tests/openstack/requests/compute/helper.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/tests/openstack/requests/compute/helper.rb
fog-1.34.0 tests/openstack/requests/compute/helper.rb
fog-1.33.0 tests/openstack/requests/compute/helper.rb
fog-1.32.0 tests/openstack/requests/compute/helper.rb
fog-1.31.0 tests/openstack/requests/compute/helper.rb
fog-1.30.0 tests/openstack/requests/compute/helper.rb
fog-1.29.0 tests/openstack/requests/compute/helper.rb
fog-1.28.0 tests/openstack/requests/compute/helper.rb