summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-05 18:39:19 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-06 16:37:08 -0700
commita03790d82a2c190d6f00ee7677617a7be04aa85d (patch)
tree0aac739e7554a7a7b7e65ccb5788efb16594d475 /lib/puppet/application
parent7e7d246bf46349c904c76a31951d4a40c200790b (diff)
downloadpuppet-a03790d82a2c190d6f00ee7677617a7be04aa85d.tar.gz
puppet-a03790d82a2c190d6f00ee7677617a7be04aa85d.tar.xz
puppet-a03790d82a2c190d6f00ee7677617a7be04aa85d.zip
(#6972) Handle ca-location in the certificate string.
This ports the existing certificate location configuration to be a string option, and then uses that to change the configuration. This will leak state between calls, which is somewhat unavoidable, but should at least get the basic stuff right for the CLI. We eventually need the CA string to be supported by a stateless internal CA implementation that allows us to do the right thing overall. Reviewed-By: Dan Bode <dan@puppetlabs.com>
Diffstat (limited to 'lib/puppet/application')
-rw-r--r--lib/puppet/application/certificate.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/puppet/application/certificate.rb b/lib/puppet/application/certificate.rb
index f4b13ffe0..eacb830b2 100644
--- a/lib/puppet/application/certificate.rb
+++ b/lib/puppet/application/certificate.rb
@@ -1,18 +1,10 @@
require 'puppet/application/indirection_base'
class Puppet::Application::Certificate < Puppet::Application::IndirectionBase
-
- # Luke used to call this --ca but that's taken by the global boolean --ca.
- # Since these options map CA terminology to indirector terminology, it's
- # now called --ca-location.
- option "--ca-location CA_LOCATION" do |arg|
- 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)"
+ unless options[:ca_location]
+ raise ArgumentError, "You must have a CA location specified;\n" +
+ "use --ca-location to specify the location (remote, local, only)"
end
location = Puppet::SSL::Host.ca_location
@@ -23,5 +15,4 @@ class Puppet::Application::Certificate < Puppet::Application::IndirectionBase
super
end
-
end