Class: Kitchen::Driver::VmpoolStores::FileBaseStore
- Includes:
- Logging
- Defined in:
- lib/kitchen/driver/vmpool_stores/file_base_store.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#pool_data(refresh = false) ⇒ Object
readonly
Returns the value of attribute pool_data.
-
#pool_file ⇒ Object
readonly
Returns the value of attribute pool_file.
Instance Method Summary collapse
- #mark_unused(name, pool_name, reuse = false) ⇒ Object
-
#take_pool_member(pool_name) ⇒ String
mark them used so nobody else can use it.
Instance Attribute Details
#pool_data(refresh = false) ⇒ Object (readonly)
Returns the value of attribute pool_data.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/file_base_store.rb', line 9 def pool_data @pool_data end |
#pool_file ⇒ Object (readonly)
Returns the value of attribute pool_file.
9 10 11 |
# File 'lib/kitchen/driver/vmpool_stores/file_base_store.rb', line 9 def pool_file @pool_file end |
Instance Method Details
#mark_unused(name, pool_name, reuse = false) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/kitchen/driver/vmpool_stores/file_base_store.rb', line 23 def mark_unused(name, pool_name, reuse = false) if reuse used_hosts(pool_name).delete(name) pool_hosts(pool_name) << name unless pool_hosts(pool_name).include?(name) end save pool_hosts(pool_name) end |
#take_pool_member(pool_name) ⇒ String
mark them used so nobody else can use it
14 15 16 17 18 19 |
# File 'lib/kitchen/driver/vmpool_stores/file_base_store.rb', line 14 def take_pool_member(pool_name) member = pool_hosts(pool_name).sample raise Kitchen::Driver::PoolMemberNotFound.new("No pool members exist for #{pool_name}, please create some pool members") unless member mark_used(member, pool_name) return member end |