From 789a955109028cde1c32bf5f3c1dd9dfc5d02ba7 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Fri, 20 Nov 2015 01:06:47 +0100 Subject: facter lib_dir: remove trailing slash Partly done by tmb --- modules/facter/lib/facter/lib_dir.rb | 2 +- modules/facter/spec/unit/lib_dir.rb | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/facter/lib/facter/lib_dir.rb b/modules/facter/lib/facter/lib_dir.rb index f612ed7e..315d7594 100644 --- a/modules/facter/lib/facter/lib_dir.rb +++ b/modules/facter/lib/facter/lib_dir.rb @@ -5,6 +5,6 @@ Facter.add("lib_dir") do rescue Facter.loadfacts() end - '/usr/lib' + ( Facter.value('architecture') == "x86_64" ? '64' : '') + '/' + '/usr/lib' + ( Facter.value('architecture') == "x86_64" ? '64' : '') end end diff --git a/modules/facter/spec/unit/lib_dir.rb b/modules/facter/spec/unit/lib_dir.rb index 1d5c4624..50049f19 100644 --- a/modules/facter/spec/unit/lib_dir.rb +++ b/modules/facter/spec/unit/lib_dir.rb @@ -5,14 +5,14 @@ require 'spec_helper' describe "Lib_dir fact" do it "should default to /usr/lib" do Facter.fact(:architecture).stubs(:value).returns("bogus") - Facter.fact(:lib_dir).value.should == "/usr/lib/" + Facter.fact(:lib_dir).value.should == "/usr/lib" end archs = Hash.new # TODO add arm 64 and others archs = { - "i586" => "/usr/lib/", - "x86_64" => "/usr/lib64/", + "i586" => "/usr/lib", + "x86_64" => "/usr/lib64", } archs.each do |arch, dir| it "should be #{dir} on #{arch}" do -- cgit v1.2.1