From 6a251b6bbf71ab0fa43149f30f424ef308906f0b Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Tue, 3 Dec 2013 17:40:03 -0500 Subject: [PATCH] Add SSL certificate to the available options when registering to RHN https://bugzilla.redhat.com/show_bug.cgi?id=1027396 --- lib/linux_admin/registration_system/rhn.rb | 1 + spec/rhn_spec.rb | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/linux_admin/registration_system/rhn.rb b/lib/linux_admin/registration_system/rhn.rb index 6612c16..832c65a 100644 --- a/lib/linux_admin/registration_system/rhn.rb +++ b/lib/linux_admin/registration_system/rhn.rb @@ -33,6 +33,7 @@ def register(options) params["--proxyPassword="] = options[:proxy_password] if options[:proxy_password] params["--serverUrl="] = options[:server_url] if options[:server_url] params["--systemorgid="] = options[:org] if options[:server_url] && options[:org] + params["--sslCACert="] = options[:server_cert] if options[:server_cert] run!(cmd, :params => params) end diff --git a/spec/rhn_spec.rb b/spec/rhn_spec.rb index 023312d..0543cf6 100644 --- a/spec/rhn_spec.rb +++ b/spec/rhn_spec.rb @@ -30,9 +30,10 @@ :proxy_address => "1.2.3.4", :proxy_username => "ProxyUser", :proxy_password => "ProxyPass", + :server_cert => "/path/to/cert", } } - let(:run_params) { {:params=>{"--username="=>"SomeUser@SomeDomain.org", "--password="=>"SomePass", "--proxy="=>"1.2.3.4", "--proxyUser="=>"ProxyUser", "--proxyPassword="=>"ProxyPass"}} } + let(:run_params) { {:params=>{"--username="=>"SomeUser@SomeDomain.org", "--password="=>"SomePass", "--proxy="=>"1.2.3.4", "--proxyUser="=>"ProxyUser", "--proxyPassword="=>"ProxyPass", "--sslCACert="=>"/path/to/cert"}} } it "with server_url" do run_params.store_path(:params, "--systemorgid=", "2")