Class: VagrantPlugins::VSphere::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vSphere/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#clone_from_vmObject

Returns the value of attribute clone_from_vm.



13
14
15
# File 'lib/vSphere/config.rb', line 13

def clone_from_vm
  @clone_from_vm
end

#compute_resource_nameObject

Returns the value of attribute compute_resource_name.



11
12
13
# File 'lib/vSphere/config.rb', line 11

def compute_resource_name
  @compute_resource_name
end

#customization_spec_nameObject

Returns the value of attribute customization_spec_name.



16
17
18
# File 'lib/vSphere/config.rb', line 16

def customization_spec_name
  @customization_spec_name
end

#data_center_nameObject

Returns the value of attribute data_center_name.



10
11
12
# File 'lib/vSphere/config.rb', line 10

def data_center_name
  @data_center_name
end

#data_store_nameObject

Returns the value of attribute data_store_name.



17
18
19
# File 'lib/vSphere/config.rb', line 17

def data_store_name
  @data_store_name
end

#hostObject

Returns the value of attribute host.



6
7
8
# File 'lib/vSphere/config.rb', line 6

def host
  @host
end

#insecureObject

Returns the value of attribute insecure.



7
8
9
# File 'lib/vSphere/config.rb', line 7

def insecure
  @insecure
end

#linked_cloneObject

Returns the value of attribute linked_clone.



18
19
20
# File 'lib/vSphere/config.rb', line 18

def linked_clone
  @linked_clone
end

#nameObject

Returns the value of attribute name.



15
16
17
# File 'lib/vSphere/config.rb', line 15

def name
  @name
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/vSphere/config.rb', line 9

def password
  @password
end

#resource_pool_nameObject

Returns the value of attribute resource_pool_name.



12
13
14
# File 'lib/vSphere/config.rb', line 12

def resource_pool_name
  @resource_pool_name
end

#template_nameObject

Returns the value of attribute template_name.



14
15
16
# File 'lib/vSphere/config.rb', line 14

def template_name
  @template_name
end

#userObject

Returns the value of attribute user.



8
9
10
# File 'lib/vSphere/config.rb', line 8

def user
  @user
end

Instance Method Details

#validate(machine) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/vSphere/config.rb', line 20

def validate(machine)
  errors = _detected_errors

  # TODO: add blank?
  errors << I18n.t('vsphere.config.host') if host.nil?
  errors <<  I18n.t('vsphere.config.user') if user.nil?
  errors <<  I18n.t('vsphere.config.password') if password.nil?
  errors <<  I18n.t('vsphere.config.template') if template_name.nil?

  # These are only required if we're cloning from an actual template
  errors << I18n.t('vsphere.config.compute_resource') if compute_resource_name.nil? and not clone_from_vm
  errors << I18n.t('vsphere.config.resource_pool') if resource_pool_name.nil? and not clone_from_vm

  { 'vSphere Provider' => errors }
end