From 133b3ade694ed0cd2b342eb7fea02843e77fced6 Mon Sep 17 00:00:00 2001 From: Jan Orel Date: Thu, 2 Oct 2025 10:49:14 +0200 Subject: [PATCH] B #-: Fix load_paths for lxc poll.rb (#3845) --- .../remotes/lxc-probes.d/vm/monitor/poll.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/im_mad/remotes/lxc-probes.d/vm/monitor/poll.rb b/src/im_mad/remotes/lxc-probes.d/vm/monitor/poll.rb index 854362c712..e9a4060e4b 100755 --- a/src/im_mad/remotes/lxc-probes.d/vm/monitor/poll.rb +++ b/src/im_mad/remotes/lxc-probes.d/vm/monitor/poll.rb @@ -1,5 +1,23 @@ #!/usr/bin/ruby +ONE_LOCATION = ENV['ONE_LOCATION'] unless defined?(ONE_LOCATION) + +if !ONE_LOCATION + LIB_LOCATION ||= '/usr/lib/one' + RUBY_LIB_LOCATION ||= '/usr/lib/one/ruby' + GEMS_LOCATION ||= '/usr/share/one/gems' +else + LIB_LOCATION ||= ONE_LOCATION + '/lib' + RUBY_LIB_LOCATION ||= ONE_LOCATION + '/lib/ruby' + GEMS_LOCATION ||= ONE_LOCATION + '/share/gems' +end + +# %%RUBYGEMS_SETUP_BEGIN%% +require 'load_opennebula_paths' +# %%RUBYGEMS_SETUP_END%% + +$LOAD_PATH << RUBY_LIB_LOCATION + require_relative '../../../lib/lxc' puts DomainList.info