diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-06-06 16:00:47 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-06-06 16:00:47 -0700 |
| commit | 4922409a2bdf3ad6a094762c9e2e60371ed16a1b (patch) | |
| tree | 024fb81d063cd399484821c0272f3a1be7e92122 /lib/puppet | |
| parent | 77a598724f961600170d8ba22cd9a11bbb7ab1e1 (diff) | |
| parent | d0d1e2ef64c4a6eecf3465dff82b62cf2cc79afb (diff) | |
| download | puppet-4922409a2bdf3ad6a094762c9e2e60371ed16a1b.tar.gz puppet-4922409a2bdf3ad6a094762c9e2e60371ed16a1b.tar.xz puppet-4922409a2bdf3ad6a094762c9e2e60371ed16a1b.zip | |
Merge branch '2.7rc' into 2.7.x
* 2.7rc:
(#7624) Manually fetch all properties in instances.
(#7193) Fix path issues with acceptance tests that call old shell tests
(#7632) Make secret_agent application compatible with secret_agent face
(#7624) Auditing should not be enabled by default for purged resources.
Diffstat (limited to 'lib/puppet')
| -rw-r--r-- | lib/puppet/application/secret_agent.rb | 21 | ||||
| -rw-r--r-- | lib/puppet/face/secret_agent.rb | 1 | ||||
| -rw-r--r-- | lib/puppet/type.rb | 10 |
3 files changed, 12 insertions, 20 deletions
diff --git a/lib/puppet/application/secret_agent.rb b/lib/puppet/application/secret_agent.rb index d704d14b2..6bdbc9232 100644 --- a/lib/puppet/application/secret_agent.rb +++ b/lib/puppet/application/secret_agent.rb @@ -1,23 +1,6 @@ -require 'puppet/application' +require 'puppet/application/face_base' require 'puppet/face' -class Puppet::Application::Secret_agent < Puppet::Application - should_parse_config +class Puppet::Application::Secret_agent < Puppet::Application::FaceBase run_mode :agent - - option("--debug", "-d") - option("--verbose", "-v") - - def setup - if options[:debug] or options[:verbose] - Puppet::Util::Log.level = options[:debug] ? :debug : :info - end - - Puppet::Util::Log.newdestination(:console) - end - - def run_command - report = Puppet::Face[:secret_agent, '0.0.1'].synchronize(Puppet[:certname]) - Puppet::Face[:report, '0.0.1'].submit(report) - end end diff --git a/lib/puppet/face/secret_agent.rb b/lib/puppet/face/secret_agent.rb index 105850cd3..79241da72 100644 --- a/lib/puppet/face/secret_agent.rb +++ b/lib/puppet/face/secret_agent.rb @@ -15,6 +15,7 @@ Puppet::Face.define(:secret_agent, '0.0.1') do EOT action(:synchronize) do + default summary "Run secret_agent once." arguments "[-v | --verbose] [-d | --debug]" # Remove this once options are introspectible description <<-'EOT' diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb index 1dbf12451..558491a7f 100644 --- a/lib/puppet/type.rb +++ b/lib/puppet/type.rb @@ -876,6 +876,12 @@ class Type # Put the default provider first, then the rest of the suitable providers. provider_instances = {} providers_by_source.collect do |provider| + all_properties = self.properties.find_all do |property| + provider.supports_parameter?(property) + end.collect do |property| + property.name + end + provider.instances.collect do |instance| # We always want to use the "first" provider instance we find, unless the resource # is already managed and has a different provider set @@ -886,7 +892,9 @@ class Type end provider_instances[instance.name] = instance - new(:name => instance.name, :provider => instance, :audit => :all) + result = new(:name => instance.name, :provider => instance) + properties.each { |name| result.newattr(name) } + result end end.flatten.compact end |
