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 @@ -64,9 +64,7 @@ module Common
6464 end
6565
6666 autorequire ( :ca ) do
67- if @parameters . has_key? ( :ca )
68- catalog . resource ( @parameters [ :ca ] . value . to_s ) . to_hash [ :name ]
69- end
67+ [ self [ :ca ] &.title ] . compact
7068 end
7169
7270 autorequire ( :file ) do
@@ -107,19 +105,16 @@ module Common
107105 end
108106 end
109107
110- define_method ( :autorequire_cert ) do |type |
111- if @parameters . has_key? ( :key_pair )
112- key_pair = catalog . resource ( @parameters [ :key_pair ] . value . to_s )
113- key_pair . to_hash [ :name ] if key_pair && key_pair . type == type
114- end
115- end
116-
117108 autorequire ( :cert ) do
118- autorequire_cert ( 'Cert' )
109+ req = [ ]
110+ req << self [ :key_pair ] . title if self [ :key_pair ] . type == 'Cert'
111+ req
119112 end
120113
121114 autorequire ( :ca ) do
122- autorequire_cert ( 'Ca' )
115+ req = [ ]
116+ req << self [ :key_pair ] . title if self [ :key_pair ] . type == 'Ca'
117+ req
123118 end
124119
125120 # 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