Issue #16189 has been updated by Henrik Lindberg.

After some investigation: 
There are two (or more :) problems in play here.

**Problem 1**: Application defaults are setup before the FaceBase class 
interprets the command line option `--mode`. At the point it has figured out 
that
it wants `:master` it is too late as the values that it will print has already 
interpolated the result based on some default.

**Problem 2**: The default value is not computed the correct way. @run_mode is 
a class instance variable and the Config class that is created for the config 
face does not inherit this class variable from FaceBase. (Such inheritance must 
be done manually in ruby). As a result, the run_mode that gets picked is nil, 
which leads to a default of the :user run mode (set in the class level run mode 
method defined in application.rb like this:
`@run_mode = Puppet::Util::RunMode[ mode_name || :user ]`). Thus, neither the 
default in Application, nor in FaceBase gets used.


----------------------------------------
Bug #16189: puppet config print and --configprint disagree
https://projects.puppetlabs.com/issues/16189#change-70952

Author: Patrick Carlisle
Status: Accepted
Priority: Normal
Assignee: 
Category: 
Target version: 3.0.0
Affected Puppet version: 3.0.0-rc5
Keywords: 
Branch: 


    thinky:puppet:% puppet master --configprint ssldir                          
                                                                                
                            <3.x>
    /etc/puppet/ssl
    thinky:puppet:% puppet config print ssldir --mode master                    
                                                                                
                            <3.x>
    /home/patrick/.puppet/ssl


-- 
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