Skip to content

Commit

Permalink
Add commands excuted when exit
Browse files Browse the repository at this point in the history
Add commands execute when exit. Saveconfig when exit.
  • Loading branch information
Zhu Lingshan committed Dec 11, 2017
1 parent fc87b6d commit 9efd7c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/clients/target.rb
Expand Up @@ -101,6 +101,7 @@ def run
Yast::Popup.Error(err_msg)
end
end
$global_data.execute_exit_commands
end
end
end
Expand Down
16 changes: 16 additions & 0 deletions src/lib/TargetData.rb
Expand Up @@ -568,6 +568,22 @@ def execute_init_commands()

end

def execute_exit_commands()
cmd = "targetcli"
commands = [
"saveconfig",
]
commands.each do |p1|
begin
Cheetah.run(cmd, p1)
rescue Cheetah::ExecutionFailed => e
if e.stderr != nil
end
end
end

end

def disable_warning_del_lun
@show_del_lun_warning = false
end
Expand Down

0 comments on commit 9efd7c3

Please sign in to comment.