mirror of
https://github.com/inspec/inspec
synced 2024-11-27 07:00:39 +00:00
Added ensure block to always delete file
This commit is contained in:
parent
652392918d
commit
af55cb41d8
1 changed files with 4 additions and 4 deletions
|
@ -40,12 +40,12 @@ class SecurityPolicy < Inspec.resource(1)
|
|||
@policy = cmd.stdout
|
||||
@loaded = true
|
||||
|
||||
# delete temp file
|
||||
cmd = inspec.command('Remove-Item win_secpol.cfg')
|
||||
return nil if cmd.exit_status.to_i != 0
|
||||
|
||||
# returns self
|
||||
self
|
||||
|
||||
ensure
|
||||
# delete temp file
|
||||
inspec.command('Remove-Item win_secpol.cfg').exit_status.to_i
|
||||
end
|
||||
|
||||
def method_missing(method)
|
||||
|
|
Loading…
Reference in a new issue