Issue #21023 has been updated by Charlie Sharpsteen.
Ok. It looks like there are two issues at play here. First, passing `--run_mode` on the command line doesn't work because the following steps occur: - CommandLine.execute hands off to Puppet.do_initialize_settings_for_run_mode - Puppet.settings.initialize_global_settings parses the `--run_mode` flag, sets it and removes it from the ARGV array - Puppet.settings.initialize_app_defaults(Puppet::Settings.app_defaults_for_run_mode(run_mode)) immediately sets the run mode back to :user two lines later - Control passes back to CommandLine.execute, which calls Application.run which also sets the run mode back to :user So, bottom line is that `--run_mode` is broken. Second thing is that this actual behavior surrounding `run_mode` was changed in [f4e229e](https://github.com/puppetlabs/puppet/commit/f4e229ee5a0a1d6a62735eb434eb2c284b7f517d) where the run mode was changed from an actual setting to an attribute of the Settings class. The problem is that things like the production Environment and the `modulepath` are cached by the Settings class. When `run_mode` was a setting, these [caches would be cleared](https://github.com/puppetlabs/puppet/blob/3.2.1/lib/puppet/settings.rb#L753-L766) when the run mode was changed. Now that `run_mode` is an attribute, the cache clearing isn't triggered anymore. ---------------------------------------- Bug #21023: puppet node clean --unexport unexports only built-in types https://projects.puppetlabs.com/issues/21023#change-92882 * Author: Peter Meier * Status: Investigating * Priority: Normal * Assignee: Charlie Sharpsteen * Category: * Target version: * Affected Puppet version: 3.2.1 * Keywords: * Branch: ---------------------------------------- Since moving from 2.7 to 3.x any exported resource that is defined by a define, won't get unexported. Only built-in types get unexported. This is because the method [type_is_ensurable](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/face/node/clean.rb#L150) does not anymore evaluate to true for defined resources. Especially [environment.known_resource_types.find_definition('', resource.restype)](https://github.com/puppetlabs/puppet/blob/master/lib/puppet/face/node/clean.rb#L154) does not anymore return the defined type if we're looking for it. How could this be fixed? -> environment.known_resource_types.find_definition('', resource.restype) should return the defined types again. Unexporting *all* defined resourced that are ensureable is a crucial task to get your nodes properly out of your infrastructure when using exported resources. -- 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
