Class: ConfigBuilder::Model::Provider::Openstack

Inherits:
Base
  • Object
show all
Defined in:
lib/config_builder/model/provider/openstack.rb

Overview

Defined Under Namespace

Modules: OpenStackConfigPatch

Constant Summary collapse

@@patch_applied =
false

Instance Method Summary collapse

Methods inherited from Base

#eval_overrides, #to_proc

Methods inherited from Base

#attr, #attrs=, #call, #configure!, def_model_attribute, def_model_delegator, def_model_id, def_model_option, #eval_models, #instance_options, model_attributes, model_delegators, #model_delegators, model_options, new_from_hash, #to_proc, #with_attr

Constructor Details

#initializeOpenstack

Returns a new instance of Openstack.



80
81
82
83
84
85
86
87
# File 'lib/config_builder/model/provider/openstack.rb', line 80

def initialize
  unless @@patch_applied
    require 'vagrant-openstack-provider/config'
    # FIXME: YAY MONKEYPATCHING
    ::VagrantPlugins::Openstack::Config.prepend(OpenStackConfigPatch)
    @@patch_applied = true
  end
end

Instance Method Details

#configure_http(config, val) ⇒ Object



94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/config_builder/model/provider/openstack.rb', line 94

def configure_http(config, val)
  val.each do |k, v|
    case k.to_sym
    when :open_timeout
      config.http.open_timeout = val
    when :read_timeout
      config.http.read_timeout = val
    when :proxy
      config.http.proxy = val
    end
  end
end

#configure_volume_boot(config, val) ⇒ Object



108
109
110
# File 'lib/config_builder/model/provider/openstack.rb', line 108

def configure_volume_boot(config, val)
  config.volume_boot = ConfigBuilder::Util.symbolize(val)
end

#instance_idObject



89
90
91
# File 'lib/config_builder/model/provider/openstack.rb', line 89

def instance_id
  'openstack'
end