File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,7 @@ module Common
7272 end
7373
7474 autorequire ( :ca ) do
75- if @parameters . has_key? ( :ca )
76- catalog . resource ( @parameters [ :ca ] . value . to_s ) . to_hash [ :name ]
77- end
75+ [ self [ :ca ] &.title ] . compact
7876 end
7977
8078 autorequire ( :file ) do
@@ -115,19 +113,16 @@ module Common
115113 end
116114 end
117115
118- define_method ( :autorequire_cert ) do |type |
119- if @parameters . has_key? ( :key_pair )
120- key_pair = catalog . resource ( @parameters [ :key_pair ] . value . to_s )
121- key_pair . to_hash [ :name ] if key_pair && key_pair . type == type
122- end
123- end
124-
125116 autorequire ( :cert ) do
126- autorequire_cert ( 'Cert' )
117+ req = [ ]
118+ req << self [ :key_pair ] . title if self [ :key_pair ] . type == 'Cert'
119+ req
127120 end
128121
129122 autorequire ( :ca ) do
130- autorequire_cert ( 'Ca' )
123+ req = [ ]
124+ req << self [ :key_pair ] . title if self [ :key_pair ] . type == 'Ca'
125+ req
131126 end
132127
133128 # Autorequire the nearest ancestor directory found in the catalog.
Original file line number Diff line number Diff line change 4040 . that_requires ( 'File[/etc/pki/katello/private/katello-default-ca.pwd]' )
4141 end
4242
43- it { is_expected . to contain_privkey ( '/etc/pki/katello/private/katello-default-ca.key' ) . that_requires ( 'Ca[katello-default-ca]' ) }
43+ it do
44+ is_expected . to contain_privkey ( '/etc/pki/katello/private/katello-default-ca.key' )
45+ . that_requires ( [ 'Ca[katello-default-ca]' , 'File[/etc/pki/katello/private/katello-default-ca.pwd]' ] )
46+ end
47+
4448 it do
4549 is_expected . to contain_file ( '/etc/pki/katello/private/katello-default-ca.key' )
46- . that_subscribes_to ( [ 'Ca[katello-default-ca]' , 'Privkey[/etc/pki/katello/private/katello-default-ca.key]' ] )
50+ . that_requires ( 'Ca[katello-default-ca]' )
51+ . that_subscribes_to ( 'Privkey[/etc/pki/katello/private/katello-default-ca.key]' )
4752 end
4853
49- it { is_expected . to contain_pubkey ( '/etc/pki/katello/certs/katello-default-ca-stripped.crt' ) . that_subscribes_to ( 'Ca[katello-default-ca]' ) }
54+ it do
55+ is_expected . to contain_pubkey ( '/etc/pki/katello/certs/katello-default-ca-stripped.crt' )
56+ . that_requires ( 'Ca[katello-default-ca]' )
57+ end
5058
5159 it { is_expected . to contain_pubkey ( '/etc/pki/katello/certs/katello-default-ca.crt' ) . that_subscribes_to ( 'Ca[katello-default-ca]' ) }
5260 it do
5361 is_expected . to contain_file ( '/etc/pki/katello/certs/katello-default-ca.crt' )
54- . that_subscribes_to ( [ 'Ca[katello-default-ca]' , 'Pubkey[/etc/pki/katello/certs/katello-default-ca.crt]' ] )
62+ . that_requires ( 'Ca[katello-default-ca]' )
63+ . that_subscribes_to ( 'Pubkey[/etc/pki/katello/certs/katello-default-ca.crt]' )
5564 end
5665
5766 it do
You can’t perform that action at this time.
0 commit comments