From 1464981d9bef70c4db52a6996653e8218aaf686a Mon Sep 17 00:00:00 2001 From: Scott Schneider Date: Fri, 4 Oct 2013 10:23:07 -0700 Subject: [PATCH] Don't YAML.load_file() twice --- vmware-host-pooler | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vmware-host-pooler b/vmware-host-pooler index 86b0155..c625082 100755 --- a/vmware-host-pooler +++ b/vmware-host-pooler @@ -16,9 +16,10 @@ Dir.chdir(File.dirname(__FILE__)) # Load the configuration file config_file = File.expand_path('vmware-host-pooler.yaml') +config = YAML.load_file(config_file) -pools = YAML.load_file(config_file)[:pools] -vsphere = YAML.load_file(config_file)[:vsphere] +pools = config[:pools] +vsphere = config[:vsphere] # Connect to vSphere $vim = RbVmomi::VIM.connect(