Issue #15185 has been updated by Chris Price.

Status changed from In Topic Branch Pending Review to Code Insufficient

Now that my memory is jogged... I've seen us handle that in other places (e.g. 
here: 
https://github.com/puppetlabs/puppet/blob/2.7.14/lib/puppet/util/run_mode.rb ) 
with code like this:

      def expand_path( dir )
        require 'etc'
        ENV["HOME"] ||= Etc.getpwuid(Process.uid).dir
        File.expand_path(dir)
      end

Daniel is correct that the previous pull req for this ticket did not do that.  
I don't know when I will have a chance to put together a new pull req but I 
will try to find some time if no one else beats me to it.
----------------------------------------
Bug #15185: Settings do not expand ~ in user configuration directory
https://projects.puppetlabs.com/issues/15185#change-65725

Author: Luke Kanies
Status: Code Insufficient
Priority: Normal
Assignee: Andrew  Parker
Category: 
Target version: 3.0.0
Affected Puppet version: 3.0.0rc3
Keywords: 
Branch: https://github.com/puppetlabs/puppet/pull/877


When using ~/.puppet as your personal configuration directory, the '~' does not 
get expanded, which means it never actually works.  The following patch makes 
it work:

    diff --git a/lib/puppet/settings.rb b/lib/puppet/settings.rb
    index 0e48096..a60abe3 100644
    --- a/lib/puppet/settings.rb
    +++ b/lib/puppet/settings.rb
    @@ -63,7 +63,7 @@ class Puppet::Settings
    end
    def self.default_user_config_dir
    -    "~/.puppet"
    +    File.expand_path("~/.puppet")
    end
    def self.default_global_var_dir
    @@ -71,7 +71,7 @@ class Puppet::Settings
    end
    def self.default_user_var_dir
    -    "~/.puppet/var"
    +    File.expand_path("~/.puppet/var")
    end
    def self.default_config_file_name    

I can't quite figure out how to test it, though, because it's set as a constant.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to