lib/config_builder/model/provider/vsphere.rb in vagrant-config_builder-0.15.1 vs lib/config_builder/model/provider/vsphere.rb in vagrant-config_builder-1.0.0.rc1

- old
+ new

@@ -1,29 +1,47 @@ # @see https://github.com/nsidc/vagrant-vsphere -class ConfigBuilder::Model::Provider::Vsphere< ConfigBuilder::Model::Base +class ConfigBuilder::Model::Provider::Vsphere< ConfigBuilder::Model::Provider::Base - VSPHERE_ATTRIBUTES = [ :host, :insecure, :user, :password, :data_center_name, :compute_resource_name, :resource_pool_name, :clone_from_vm, :template_name, :name, :vm_base_path, :customization_spec_name, :data_store_name, :linked_clone, :proxy_host, :proxy_port, :vlan ] + def_model_attribute :host + def_model_attribute :insecure + def_model_attribute :user + def_model_attribute :password + def_model_attribute :data_center_name + def_model_attribute :compute_resource_name + def_model_attribute :resource_pool_name + def_model_attribute :clone_from_vm + def_model_attribute :template_name + def_model_attribute :name + def_model_attribute :vm_base_path + def_model_attribute :customization_spec_name + def_model_attribute :data_store_name + def_model_attribute :linked_clone + def_model_attribute :proxy_host + def_model_attribute :proxy_port + def_model_attribute :vlan + def_model_attribute :addressType + def_model_attribute :mac + def_model_attribute :memory_mb + def_model_attribute :cpu_count + def_model_attribute :cpu_reservation + def_model_attribute :mem_reservation - # @!attribute [rw] - # The mandatory attributes will be verified by vagrant-vsphere - # @see https://github.com/nsidc/vagrant-vsphere#configuration - VSPHERE_ATTRIBUTES.each do |key| - def_model_attribute attr - end + def_model_attribute :custom_attributes def initialize @defaults = { :insecure => false, } end - def to_proc - Proc.new do |vm_config| - vm_config.provider 'vsphere' do |config| - VSPHERE_ATTRIBUTES.each do |key| - config.send("#{key}=", attr(key)) if attr(key) - end - end + def instance_id + 'vsphere' + end + + # @private + def config_custom_attributes(config, val) + val.each do |e| + config.custom_attribute(*e) end end ConfigBuilder::Model::Provider.register('vsphere', self) end