diff options
| author | nfagerlund <nick.fagerlund@gmail.com> | 2011-05-23 11:14:03 -0700 |
|---|---|---|
| committer | nfagerlund <nick.fagerlund@gmail.com> | 2011-06-06 13:43:52 -0700 |
| commit | 31bf55c2f9c090c40e48f38c5f64e4373a402261 (patch) | |
| tree | 34957d890784a3625d346de41af399d374274af0 /lib/puppet/application | |
| parent | c5448b79e690d72536f4d98b636f450d37de627a (diff) | |
| download | puppet-31bf55c2f9c090c40e48f38c5f64e4373a402261.tar.gz puppet-31bf55c2f9c090c40e48f38c5f64e4373a402261.tar.xz puppet-31bf55c2f9c090c40e48f38c5f64e4373a402261.zip | |
(#7632) Make secret_agent application compatible with secret_agent face
Running `puppet secret_agent` was failing with an error in validate_args (in
interface/action.rb), because the application was trying to pass the certname as
an argument to the synchronize action. Also, it was trying to submit the report
a second time. Reviewing the code with Nick0, we found that the application
wasn't inheriting from FaceBase and was duplicating a lot of work, and were able
to resolve the issue by basically deleting the whole thing.
This patch makes secret_agent behave like the other Faces apps, and makes
synchronize the default action of the secret_agent face. We left the `run_mode
:agent` line in the application because of bug #7802.
Paired-with: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/secret_agent.rb | 21 |
1 files changed, 2 insertions, 19 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 |
