File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,16 @@ def main
146
146
when 'verify'
147
147
verify ( certname )
148
148
when 'clean'
149
+ possible_extra_args = command_line . args . drop ( 1 )
150
+ unless possible_extra_args . empty?
151
+ raise Puppet ::Error , _ ( <<END ) % { args : possible_extra_args . join ( ' ' ) }
152
+ Extra arguments detected: %{args}
153
+ Did you mean to run:
154
+ puppetserver ca clean --certname <name>
155
+ Or:
156
+ puppet ssl clean --target <name>
157
+ END
158
+ end
149
159
clean ( certname )
150
160
when 'bootstrap'
151
161
if !Puppet ::Util ::Log . sendlevel? ( :info )
Original file line number Diff line number Diff line change @@ -391,6 +391,11 @@ def expects_command_to_fail(message)
391
391
expects_command_to_fail ( %r{Failed to connect to the CA to determine if certificate #{ name } has been cleaned} )
392
392
end
393
393
394
+ it 'raises if we have extra args' do
395
+ ssl . command_line . args << 'hostname.example.biz'
396
+ expects_command_to_fail ( /Extra arguments detected: hostname.example.biz/ )
397
+ end
398
+
394
399
context 'when deleting local CA' do
395
400
before do
396
401
ssl . command_line . args << '--localca'
You can’t perform that action at this time.
0 commit comments