From 882fc3652193e10f034e9c79bae89450f10a95a5 Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Tue, 1 Oct 2013 16:41:15 -0700 Subject: [PATCH] Don't use .fog for vSphere credentials --- lib/vsphere_helper.rb | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/vsphere_helper.rb b/lib/vsphere_helper.rb index 534dee0..afe29e6 100755 --- a/lib/vsphere_helper.rb +++ b/lib/vsphere_helper.rb @@ -9,12 +9,14 @@ class VsphereHelper raise "Unable to load RbVmomi, please ensure its installed" end - fog_file = File.expand_path("~/.fog") - fog_data = YAML.load_file(fog_file)[:default] + Dir.chdir(File.dirname(__FILE__)) - @connection = RbVmomi::VIM.connect :host => fog_data[:vsphere_server], - :user => fog_data[:vsphere_username], - :password => fog_data[:vsphere_password], + config_file = File.expand_path('../vmware-host-pooler.yaml') + vsphere = YAML.load_file(config_file)[:vsphere] + + @connection = RbVmomi::VIM.connect :host => vsphere['server'], + :user => vsphere['username'], + :password => vsphere['password'], :insecure => true end