diff options
| author | Richard Crowley <r@rcrowley.org> | 2011-03-23 17:45:46 +0000 |
|---|---|---|
| committer | Richard Crowley <r@rcrowley.org> | 2011-03-23 17:45:46 +0000 |
| commit | 961c7163f336c0dd96f7f72122af9155e1a2260a (patch) | |
| tree | e1f5d044600492cff56d0de1eda4df1157799b7b /lib/puppet/application | |
| parent | a7a9e125018c7a3fd0f0afc543f7aeaea1c19525 (diff) | |
| download | puppet-961c7163f336c0dd96f7f72122af9155e1a2260a.tar.gz puppet-961c7163f336c0dd96f7f72122af9155e1a2260a.tar.xz puppet-961c7163f336c0dd96f7f72122af9155e1a2260a.zip | |
Added list action.
The common tasks of checking the --ca-location argument and becoming a CA process if necessary (that is, acting like a master) have been abstracted into the Application where they belong.
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/certificate.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/puppet/application/certificate.rb b/lib/puppet/application/certificate.rb index 48736fc84..f4b13ffe0 100644 --- a/lib/puppet/application/certificate.rb +++ b/lib/puppet/application/certificate.rb @@ -9,4 +9,19 @@ class Puppet::Application::Certificate < Puppet::Application::IndirectionBase Puppet::SSL::Host.ca_location = arg.to_sym end + def setup + + unless Puppet::SSL::Host.ca_location + raise ArgumentError, "You must have a CA location specified; use --ca-location to specify the location (remote, local, only)" + end + + location = Puppet::SSL::Host.ca_location + if location == :local && !Puppet::SSL::CertificateAuthority.ca? + self.class.run_mode("master") + self.set_run_mode self.class.run_mode + end + + super + end + end |
