Class: VagrantPlugins::OVirtProvider::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant-ovirt/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



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

def initialize
  @url       = UNSET_VALUE
  @username   = UNSET_VALUE
  @password   = UNSET_VALUE
  @datacenter = UNSET_VALUE
  @cluster    = UNSET_VALUE
  @ip_command = UNSET_VALUE

  # Domain specific settings.
  @memory     = UNSET_VALUE
  @cpus       = UNSET_VALUE
  @template   = UNSET_VALUE
  @quota      = UNSET_VALUE
end

Instance Attribute Details

#clusterObject

Returns the value of attribute cluster.



11
12
13
# File 'lib/vagrant-ovirt/config.rb', line 11

def cluster
  @cluster
end

#cpusObject

Returns the value of attribute cpus.



16
17
18
# File 'lib/vagrant-ovirt/config.rb', line 16

def cpus
  @cpus
end

#datacenterObject

Returns the value of attribute datacenter.



10
11
12
# File 'lib/vagrant-ovirt/config.rb', line 10

def datacenter
  @datacenter
end

#ip_commandObject

Returns the value of attribute ip_command.



12
13
14
# File 'lib/vagrant-ovirt/config.rb', line 12

def ip_command
  @ip_command
end

#memoryObject

Domain specific settings used while creating new machine.



15
16
17
# File 'lib/vagrant-ovirt/config.rb', line 15

def memory
  @memory
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/vagrant-ovirt/config.rb', line 9

def password
  @password
end

#quotaObject

Returns the value of attribute quota.



18
19
20
# File 'lib/vagrant-ovirt/config.rb', line 18

def quota
  @quota
end

#templateObject

Returns the value of attribute template.



17
18
19
# File 'lib/vagrant-ovirt/config.rb', line 17

def template
  @template
end

#urlObject

Returns the value of attribute url.



7
8
9
# File 'lib/vagrant-ovirt/config.rb', line 7

def url
  @url
end

#usernameObject

Returns the value of attribute username.



8
9
10
# File 'lib/vagrant-ovirt/config.rb', line 8

def username
  @username
end

Instance Method Details

#finalize!Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/vagrant-ovirt/config.rb', line 35

def finalize!
  @url = nil if @url == UNSET_VALUE
  @username = nil if @username == UNSET_VALUE
  @password = nil if @password == UNSET_VALUE
  @datacenter = nil if @datacenter == UNSET_VALUE
  @cluster = nil if @cluster == UNSET_VALUE
  if @ip_command == UNSET_VALUE
    @ip_command = 'arp -an | grep -i $MAC | sed "s/.*(\(.*\)).*/\1/"'
  end

  # Domain specific settings.
  @memory = 512 if @memory == UNSET_VALUE
  @cpus = 1 if @cpus == UNSET_VALUE
  @template = 'Blank' if @template == UNSET_VALUE
  @quota = nil if @quota == UNSET_VALUE
end

#validate(machine) ⇒ Object



52
53
# File 'lib/vagrant-ovirt/config.rb', line 52

def validate(machine)
end