Skip to content

Commit fb36fe1

Browse files
author
Travis Fields
committed
(MODULES-2561) resolve title properly when on windows
- Lambda expression match was not restrictive enough to match properly for windows and was splitting on second ':' and not the first, this addes a new pattern match for windows that expects a letter based path in the title i.e. 'C:\tmp'
1 parent 3323cf6 commit fb36fe1

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/puppet/type/java_ks.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ def self.title_patterns
151151
[ :name, identity ]
152152
]
153153
],
154+
[
155+
/^(.*):([a-z]:(\/|\\).*)$/i,
156+
[
157+
[ :name, identity ],
158+
[ :target, identity ]
159+
]
160+
],
154161
[
155162
/^(.*):(.*)$/,
156163
[

spec/acceptance/destkeypass_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
describe 'password protected java private keys', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
66
include_context 'common variables'
7-
7+
88
let(:confdir) { default['puppetpath'] }
99
let(:modulepath) { default['distmoduledir'] }
10-
10+
1111
case fact('osfamily')
1212
when "windows"
1313
target = 'c:/private_key.ks'
1414
else
1515
target = '/etc/private_key.ks'
1616
end
17-
17+
1818
it 'creates a password protected private key' do
1919
pp = <<-EOS
2020
java_ks { 'broker.example.com:#{target}':

0 commit comments

Comments
 (0)