Skip to content

Commit

Permalink
Merge remote-tracking branch 'joshcooper/ticket/master/HI-298-windows'
Browse files Browse the repository at this point in the history
* joshcooper/ticket/master/HI-298-windows:
  (HI-298) Move hiera data to C:\ProgramData\PuppetLabs\code
  • Loading branch information
Iristyle committed Feb 26, 2015
2 parents b2423a6 + 0efd927 commit d556bc1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion ext/hiera.yaml
Expand Up @@ -10,6 +10,6 @@
:yaml:
# datadir is empty here, so hiera uses its defaults:
# - /etc/puppetlabs/code/hieradata on *nix
# - %CommonAppData%\PuppetLabs\hiera\var on Windows
# - %CommonAppData%\PuppetLabs\code\hieradata on Windows
# When specifying a datadir, make sure the directory exists.
:datadir:
6 changes: 3 additions & 3 deletions lib/hiera/util.rb
Expand Up @@ -9,7 +9,7 @@ def posix?

def microsoft_windows?
return false unless file_alt_separator

begin
require 'win32/dir'
true
Expand All @@ -21,15 +21,15 @@ def microsoft_windows?

def config_dir
if microsoft_windows?
File.join(common_appdata, 'PuppetLabs', 'hiera', 'etc')
File.join(common_appdata, 'PuppetLabs', 'code')
else
'/etc/puppetlabs/code'
end
end

def var_dir
if microsoft_windows?
File.join(common_appdata, 'PuppetLabs', 'hiera', 'var')
File.join(common_appdata, 'PuppetLabs', 'code', 'hieradata')
else
'/etc/puppetlabs/code/hieradata'
end
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/util_spec.rb
Expand Up @@ -29,7 +29,7 @@
it 'should return the correct path for microsoft windows systems' do
Hiera::Util.expects(:microsoft_windows?).returns(true)
Hiera::Util.expects(:common_appdata).returns('C:\\ProgramData')
Hiera::Util.config_dir.should == 'C:\\ProgramData/PuppetLabs/hiera/etc'
Hiera::Util.config_dir.should == 'C:\\ProgramData/PuppetLabs/code'
end
end

Expand All @@ -42,7 +42,7 @@
it 'should return the correct path for microsoft windows systems' do
Hiera::Util.expects(:microsoft_windows?).returns(true)
Hiera::Util.expects(:common_appdata).returns('C:\\ProgramData')
Hiera::Util.var_dir.should == 'C:\\ProgramData/PuppetLabs/hiera/var'
Hiera::Util.var_dir.should == 'C:\\ProgramData/PuppetLabs/code/hieradata'
end
end
end
Expand Down

0 comments on commit d556bc1

Please sign in to comment.