From c9515abd9284b399ffcdac350f2e34f365e9bd6b Mon Sep 17 00:00:00 2001 From: Tino Vazquez Date: Thu, 10 Oct 2019 18:24:43 +0200 Subject: [PATCH] M #-: Avoid redefinition of ruby library path --- .../lib/vcenter_driver/virtual_machine.rb | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb index ff06a8f68a..f79c8f8f4d 100644 --- a/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb +++ b/src/vmm_mad/remotes/lib/vcenter_driver/virtual_machine.rb @@ -15,14 +15,22 @@ #--------------------------------------------------------------------------- # module VCenterDriver - ONE_LOCATION = ENV['ONE_LOCATION'] + ONE_LOCATION = ENV['ONE_LOCATION'] unless defined?(ONE_LOCATION) if !ONE_LOCATION - RUBY_LIB_LOCATION = '/usr/lib/one/ruby' - GEMS_LOCATION = '/usr/share/one/gems' + unless defined?(RUBY_LIB_LOCATION) + RUBY_LIB_LOCATION = '/usr/lib/one/ruby' + end + unless defined?(GEMS_LOCATION) + GEMS_LOCATION = '/usr/share/one/gems' + end else - RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby' - GEMS_LOCATION = ONE_LOCATION + '/share/gems' + unless defined?(RUBY_LIB_LOCATION) + RUBY_LIB_LOCATION = ONE_LOCATION + '/lib/ruby' + end + unless defined?(GEMS_LOCATION) + GEMS_LOCATION = ONE_LOCATION + '/share/gems' + end end if File.directory?(GEMS_LOCATION)