Skip to content

Commit

Permalink
Add code to handle service enable/disable
Browse files Browse the repository at this point in the history
Add code to handle service enable/disable
  • Loading branch information
Zhu Lingshan committed Feb 12, 2018
1 parent bc5dd3e commit 681ac70
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions package/yast2-iscsi-lio-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Mon Feb 12 13:59:06 UTC 2018 - lszhu@suse.com

- fate#319238
Add code to handle targetcli.service enable / disable.

-------------------------------------------------------------------
Thu Feb 1 11:41:10 UTC 2018 - lszhu@suse.com

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-iscsi-lio-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-iscsi-lio-server
Version: 4.0.3
Version: 4.0.4
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
8 changes: 6 additions & 2 deletions src/include/iscsi-lio-server/UI_dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ class ServiceTab < ::CWM::Tab
def initialize
textdomain "iscsi-lio-server"
self.initial = true
@service = Yast::SystemdService.find("sshd.service")
@service = Yast::SystemdService.find("targetcli.service")
@service_status = ::UI::ServiceStatus.new(@service, reload_flag: true, reload_flag_label: :restart)
@firewall_widget = ::CWM::WrapperWidget.new(
CWMFirewallInterfaces.CreateOpenFirewallWidget("services" => ["iscsi-target"]),
Expand All @@ -436,8 +436,12 @@ def contents
end

def handle(event)
puts event
@service_status.handle_input(event["ID"])
if @service_status.enabled_flag?
@service.enable
else
@service.disable
end
nil
end

Expand Down

0 comments on commit 681ac70

Please sign in to comment.