Class: VagrantPlugins::OVirtProvider::Config
- Inherits:
-
Object
- Object
- VagrantPlugins::OVirtProvider::Config
- Defined in:
- lib/vagrant-ovirt/config.rb
Instance Attribute Summary collapse
-
#cluster ⇒ Object
Returns the value of attribute cluster.
-
#cpus ⇒ Object
Returns the value of attribute cpus.
-
#datacenter ⇒ Object
Returns the value of attribute datacenter.
-
#ip_command ⇒ Object
Returns the value of attribute ip_command.
-
#memory ⇒ Object
Domain specific settings used while creating new machine.
-
#password ⇒ Object
Returns the value of attribute password.
-
#quota ⇒ Object
Returns the value of attribute quota.
-
#template ⇒ Object
Returns the value of attribute template.
-
#url ⇒ Object
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #finalize! ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
- #validate(machine) ⇒ Object
Constructor Details
#initialize ⇒ Config
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
#cluster ⇒ Object
Returns the value of attribute cluster.
11 12 13 |
# File 'lib/vagrant-ovirt/config.rb', line 11 def cluster @cluster end |
#cpus ⇒ Object
Returns the value of attribute cpus.
16 17 18 |
# File 'lib/vagrant-ovirt/config.rb', line 16 def cpus @cpus end |
#datacenter ⇒ Object
Returns the value of attribute datacenter.
10 11 12 |
# File 'lib/vagrant-ovirt/config.rb', line 10 def datacenter @datacenter end |
#ip_command ⇒ Object
Returns the value of attribute ip_command.
12 13 14 |
# File 'lib/vagrant-ovirt/config.rb', line 12 def ip_command @ip_command end |
#memory ⇒ Object
Domain specific settings used while creating new machine.
15 16 17 |
# File 'lib/vagrant-ovirt/config.rb', line 15 def memory @memory end |
#password ⇒ Object
Returns the value of attribute password.
9 10 11 |
# File 'lib/vagrant-ovirt/config.rb', line 9 def password @password end |
#quota ⇒ Object
Returns the value of attribute quota.
18 19 20 |
# File 'lib/vagrant-ovirt/config.rb', line 18 def quota @quota end |
#template ⇒ Object
Returns the value of attribute template.
17 18 19 |
# File 'lib/vagrant-ovirt/config.rb', line 17 def template @template end |
#url ⇒ Object
Returns the value of attribute url.
7 8 9 |
# File 'lib/vagrant-ovirt/config.rb', line 7 def url @url end |
#username ⇒ Object
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 |