From 24c043c506d539044d048638eee0a3e05adfaf07 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Thu, 26 Jan 2017 19:37:14 -0800 Subject: [PATCH] f base.rb (backingservice) --- lib/vmpooler/backingservice/base.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/vmpooler/backingservice/base.rb b/lib/vmpooler/backingservice/base.rb index a977a31..a508b72 100644 --- a/lib/vmpooler/backingservice/base.rb +++ b/lib/vmpooler/backingservice/base.rb @@ -5,6 +5,13 @@ module Vmpooler # These defs must be overidden in child classes def initialize(options) + @options = options + end + + # returns + # [String] Name of the backing service + def name + 'base' end #def validate_config(config) @@ -15,7 +22,7 @@ module Vmpooler # pool : hashtable from config file # returns # hashtable - # name : name of the device + # name : name of the device <---- TODO is this all? def vms_in_pool(pool) fail "#{self.class.name} does not implement vms_in_pool" end @@ -51,6 +58,7 @@ module Vmpooler # returns # nil if it doesn't exist # Hastable of the VM + # [String] name = Name of the VM # [String] hostname = Name reported by Vmware tools (host.summary.guest.hostName) # [String] template = This is the name of template exposed by the API. It must _match_ the poolname # [String] poolname = Name of the pool the VM is located @@ -93,7 +101,7 @@ module Vmpooler # returns # result: boolean def vm_exists?(vm) - fail "#{self.class.name} does not implement vm_exists?" + !get_vm(vm).nil? end end