diff --git a/src/tm_mad/lib/backup_lvmthin.rb b/src/tm_mad/lib/backup_lvmthin.rb index ea6bfbc87e..af8f58bca3 100755 --- a/src/tm_mad/lib/backup_lvmthin.rb +++ b/src/tm_mad/lib/backup_lvmthin.rb @@ -15,6 +15,25 @@ # See the License for the specific language governing permissions and # # limitations under the License. # #--------------------------------------------------------------------------- # + +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 + $LOAD_PATH.unshift('/var/tmp/one') require 'fileutils'