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 @@ -147,6 +147,16 @@ def main
147
147
when 'verify'
148
148
verify ( certname )
149
149
when 'clean'
150
+ possible_extra_args = command_line . args . drop ( 1 )
151
+ unless possible_extra_args . empty?
152
+ raise Puppet ::Error , _ ( <<END ) % { args : possible_extra_args . join ( ' ' ) }
153
+ Extra arguments detected: %{args}
154
+ Did you mean to run:
155
+ puppetserver ca clean --certname <name>
156
+ Or:
157
+ puppet ssl clean --target <name>
158
+ END
159
+ end
150
160
clean ( certname )
151
161
when 'bootstrap'
152
162
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