From 100b925e97be4ff8bf9e09850df6a3cee536e4c6 Mon Sep 17 00:00:00 2001 From: mo khan Date: Tue, 5 May 2020 17:03:46 -0600 Subject: Extract variable for keystore_path --- lib/license/management/shell.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/license/management/shell.rb b/lib/license/management/shell.rb index 7baa6ba..9053a3f 100644 --- a/lib/license/management/shell.rb +++ b/lib/license/management/shell.rb @@ -48,6 +48,7 @@ module License Dir.glob('custom.*.crt').each do |path| full_path = File.expand_path(path) execute([:openssl, :x509, '-in', full_path, '-text', '-noout']) + keystore_path = "#{ENV['JAVA_HOME']}/jre/lib/security/cacerts" execute([ :keytool, '-importcert', @@ -56,12 +57,12 @@ module License '-trustcacerts', '-noprompt', '-storepass', 'changeit', - '-keystore', "#{ENV['JAVA_HOME']}/jre/lib/security/cacerts" + '-keystore', keystore_path ]) execute([ :keytool, '-list', '-v', '-storepass changeit', - '-keystore', "#{ENV['JAVA_HOME']}/jre/lib/security/cacerts" + '-keystore', keystore_path ]) end end -- cgit v1.2.3