Skip to content
Permalink
Browse files

Merge pull request #78 from yast/revert-77-feature/service_widget

Revert "Use the new ServiceWidget"
  • Loading branch information...
imobachgs committed Aug 16, 2018
2 parents 191f9f9 + dde3ddf commit 7e62818eee397b4d554d00bfe11258cfe63772de
@@ -1,10 +1,3 @@
-------------------------------------------------------------------
Tue Aug 7 12:09:41 UTC 2018 - dgonzalez@suse.com

- Use Yast2::ServiceWidget to manage the service status
(part of fate#319428).
- 4.1.0

-------------------------------------------------------------------
Wed Jun 27 15:21:50 CEST 2018 - schubi@suse.de

@@ -17,24 +17,23 @@


Name: yast2-iscsi-lio-server
Version: 4.1.0
Version: 4.0.11
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2

BuildRequires: update-desktop-files
# Yast2::ServiceWidget
BuildRequires: yast2 >= 4.1.0
BuildRequires: yast2
BuildRequires: yast2-devtools >= 3.1.10
BuildRequires: rubygem(%rb_default_ruby_abi:rspec)
BuildRequires: rubygem(%rb_default_ruby_abi:yast-rake)
Requires: python3-configshell-fb
Requires: python3-rtslib-fb
Requires: python3-targetcli-fb

# Yast2::ServiceWidget
Requires: yast2 >= 4.1.0
#Replace SuSEFirewall2 by firewalld
Requires: yast2 >= 4.0.39

BuildArch: noarch

@@ -1,15 +1,21 @@
require_relative '../include/iscsi-lio-server/iscsi-lio-server_helper.rb'
require_relative '../include/iscsi-lio-server/TargetData.rb'
require_relative '../include/iscsi-lio-server/UI_dialogs.rb'
require "cwm/widget"
require "ui/service_status"
require "yast"
require "yast2/execute"
require "y2firewall/firewalld"

Yast.import "CWM"
Yast.import "CWMTab"
Yast.import "TablePopup"
Yast.import "CWMServiceStart"
Yast.import "Popup"
Yast.import "Wizard"
Yast.import "CWMFirewallInterfaces"
Yast.import "Service"
Yast.import "CWMServiceStart"
Yast.import "UI"
Yast.import "Confirm"

@@ -65,9 +71,9 @@ def run
contents = VBox(tabs,VStretch())
Yast::Wizard.CreateDialog
ret = CWM.show(contents, caption: _("Yast iSCSI Targets"),next_button: _("Finish"))
Yast::Wizard.CloseDialog
if ret == :next
firewalld.write
service_tab.write
status = $discovery_auth.fetch_status
userid = $discovery_auth.fetch_userid
password = $discovery_auth.fetch_password
@@ -104,8 +110,8 @@ def run
end
$global_data.execute_exit_commands
end
Yast::Wizard.CloseDialog
end

end
end

@@ -1,21 +1,23 @@
require_relative './iscsi-lio-server_helper.rb'
require_relative './TargetData.rb'
require 'cwm/widget'
require 'ui/service_status'
require 'yast'
require 'yast2/execute'
require 'yast2/system_service'

require 'cwm/table'
require 'cwm/dialog'
require 'cwm/widget'
require 'cwm/service_widget'

require_relative './iscsi-lio-server_helper.rb'
require_relative './TargetData.rb'
require 'yast2/execute'

Yast.import 'CWM'
Yast.import 'CWMTab'
Yast.import 'TablePopup'
Yast.import 'CWMServiceStart'
Yast.import 'Popup'
Yast.import 'Wizard'
Yast.import 'CWMFirewallInterfaces'
Yast.import 'Service'
Yast.import 'CWMServiceStart'
Yast.import 'UI'
Yast.import 'TablePopup'

class NoDiscoveryAuth_CheckBox < ::CWM::CheckBox
def initialize(container,value)
@@ -406,58 +408,56 @@ module Yast
class ServiceTab < ::CWM::Tab
include Yast::I18n
include Yast::UIShortcuts

def initialize
textdomain "iscsi-lio-server"

self.initial = true
@service = Yast2::SystemService.find("targetcli")
@service_widget = ::CWM::ServiceWidget.new(@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"]),
)
end

def label
_('Service')
CWMFirewallInterfaces.CreateOpenFirewallWidget("services" => ["iscsi-target"]),
)
end

def contents
VBox(
VStretch(),
HBox(
HStretch(),
HSpacing(1),
VBox(
@service_widget,
VSpacing(2),
@firewall_widget,
VSpacing(2)
VStretch(),
HBox(
HStretch(),
HSpacing(1),
VBox(@service_status.widget,
VSpacing(2),
@firewall_widget,
VSpacing(2)),
HSpacing(1),
HStretch()
),
HSpacing(1),
HStretch()
),
VStretch()
VStretch()
)
end

def store
@service_widget.store
end

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

def opt
[:notify]
end

def label
_('Service')
end

def help
help_msg = _("<h1>iSCSI Target</h1>")
help_msg = _("<h1>iSCSI Target</h1>")
help_msg += _("<h2>Service Start</h2>")
help_msg += _("To start the service every time your computer is booted, \
set to <b>Start on boot</b>. Otherwise choose <b>Do not start</b>.\n")
set <b>When Booting</b>. Otherwise set <b>Manually</b>.\n")
help_msg += _("<h2>Firewall Settings</h2>")
help_msg += _("To open the firewall to allow access to the service from remote computers, \
set <b>Open Port in Firewall</b>.\n")

0 comments on commit 7e62818

Please sign in to comment.
You can’t perform that action at this time.