Hello community,
here is the log from the commit of package yast2-dhcp-server for openSUSE:Factory checked in at 2018-09-05 13:48:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-dhcp-server (Old)
and /work/SRC/openSUSE:Factory/.yast2-dhcp-server.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-dhcp-server"
Wed Sep 5 13:48:58 2018 rev:54 rq:631396 version:4.1.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-dhcp-server/yast2-dhcp-server.changes 2018-08-06 11:53:51.261200254 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-dhcp-server.new/yast2-dhcp-server.changes 2018-09-05 13:49:03.594308409 +0200
@@ -1,0 +2,32 @@
+Fri Aug 24 14:21:19 UTC 2018 - dgonzalez@suse.com
+
+- Display an information message instead of the service widget
+ when service is not installed (related to fate#319428).
+- 4.1.2
+
+-------------------------------------------------------------------
+Thu Aug 23 09:38:55 UTC 2018 - dgonzalez@suse.com
+
+- Avoid module to crash if service is not installed
+ (related to fate#319428).
+- 4.1.1
+
+-------------------------------------------------------------------
+Mon Aug 20 13:47:16 CEST 2018 - schubi@suse.de
+
+- Switched license in spec file from SPDX2 to SPDX3 format.
+
+-------------------------------------------------------------------
+Tue Aug 13 12:00:22 UTC 2018 - dgonzalez@suse.com
+
+- Use CWM::ServiceWidget to manage the service status
+ (part of fate#319428).
+- 4.1.0
+
+-------------------------------------------------------------------
+Mon Aug 13 10:32:56 UTC 2018 - igonzalezsosa@suse.com
+
+- Fix package building with yast2 4.0.84 (bsc#1104644).
+- 4.0.3
+
+-------------------------------------------------------------------
Old:
----
yast2-dhcp-server-4.0.2.tar.bz2
New:
----
yast2-dhcp-server-4.1.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-dhcp-server.spec ++++++
--- /var/tmp/diff_new_pack.Ez6Ody/_old 2018-09-05 13:49:03.962309027 +0200
+++ /var/tmp/diff_new_pack.Ez6Ody/_new 2018-09-05 13:49:03.962309027 +0200
@@ -17,7 +17,7 @@
Name: yast2-dhcp-server
-Version: 4.0.2
+Version: 4.1.2
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -36,8 +36,8 @@
BuildRequires: yast2-dns-server
BuildRequires: yast2-perl-bindings
BuildRequires: yast2-testsuite
-# UI::ServiceStatus
-BuildRequires: yast2 >= 3.1.161
+# Yast2::ServiceWidget
+BuildRequires: yast2 >= 4.1.0
Requires: bind-utils
Requires: perl-Digest-SHA1
@@ -46,8 +46,8 @@
Requires: perl-gettext
Requires: yast2-ldap
Requires: yast2-perl-bindings
-# UI::ServiceStatus
-Requires: yast2 >= 3.1.161
+# Yast2::ServiceWidget
+Requires: yast2 >= 4.1.0
# DnsServerAPI::IsServiceConfigurableExternally
Requires: yast2-dns-server >= 2.13.16
@@ -56,7 +56,7 @@
Requires: yast2-ruby-bindings >= 1.0.0
Summary: YaST2 - DHCP Server Configuration
-License: GPL-2.0
+License: GPL-2.0-only
Group: System/YaST
%description
++++++ yast2-dhcp-server-4.0.2.tar.bz2 -> yast2-dhcp-server-4.1.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/package/yast2-dhcp-server.changes new/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.changes
--- old/yast2-dhcp-server-4.0.2/package/yast2-dhcp-server.changes 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.changes 2018-08-24 17:09:37.000000000 +0200
@@ -1,4 +1,36 @@
-------------------------------------------------------------------
+Fri Aug 24 14:21:19 UTC 2018 - dgonzalez@suse.com
+
+- Display an information message instead of the service widget
+ when service is not installed (related to fate#319428).
+- 4.1.2
+
+-------------------------------------------------------------------
+Thu Aug 23 09:38:55 UTC 2018 - dgonzalez@suse.com
+
+- Avoid module to crash if service is not installed
+ (related to fate#319428).
+- 4.1.1
+
+-------------------------------------------------------------------
+Mon Aug 20 13:47:16 CEST 2018 - schubi@suse.de
+
+- Switched license in spec file from SPDX2 to SPDX3 format.
+
+-------------------------------------------------------------------
+Tue Aug 13 12:00:22 UTC 2018 - dgonzalez@suse.com
+
+- Use CWM::ServiceWidget to manage the service status
+ (part of fate#319428).
+- 4.1.0
+
+-------------------------------------------------------------------
+Mon Aug 13 10:32:56 UTC 2018 - igonzalezsosa@suse.com
+
+- Fix package building with yast2 4.0.84 (bsc#1104644).
+- 4.0.3
+
+-------------------------------------------------------------------
Fri Aug 3 09:39:35 UTC 2018 - igonzalezsosa@suse.com
- Fix package building with yast2 4.0.80 (bsc#1103691).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/package/yast2-dhcp-server.spec new/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.spec
--- old/yast2-dhcp-server-4.0.2/package/yast2-dhcp-server.spec 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/package/yast2-dhcp-server.spec 2018-08-24 17:09:37.000000000 +0200
@@ -17,22 +17,22 @@
Name: yast2-dhcp-server
-Version: 4.0.2
+Version: 4.1.2
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2
Group: System/YaST
-License: GPL-2.0
+License: GPL-2.0-only
BuildRequires: perl-Digest-SHA1 perl-X500-DN perl-XML-Writer docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2-perl-bindings yast2-testsuite yast2-dns-server
BuildRequires: yast2-devtools >= 3.1.10
-# UI::ServiceStatus
-BuildRequires: yast2 >= 3.1.161
+# Yast2::ServiceWidget
+BuildRequires: yast2 >= 4.1.0
Requires: perl-gettext yast2-perl-bindings bind-utils perl-X500-DN yast2-ldap perl-Digest-SHA1 perl-Parse-RecDescent
-# UI::ServiceStatus
-Requires: yast2 >= 3.1.161
+# Yast2::ServiceWidget
+Requires: yast2 >= 4.1.0
# DnsServerAPI::IsServiceConfigurableExternally
Requires: yast2-dns-server >= 2.13.16
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/dialogs.rb new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/dialogs.rb
--- old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/dialogs.rb 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/dialogs.rb 2018-08-24 17:09:37.000000000 +0200
@@ -10,8 +10,13 @@
#
# Representation of the configuration of dhcp-server.
# Input and output routines.
+
+require "yast2/popup"
+
module Yast
module DhcpServerDialogsInclude
+ include Yast::Logger
+
def initialize_dhcp_server_dialogs(include_target)
textdomain "dhcp-server"
@@ -23,6 +28,7 @@
Yast.import "Popup"
Yast.import "Label"
Yast.import "Confirm"
+ Yast.import "Mode"
@functions = { :abort => fun_ref(method(:confirmAbort), "boolean ()") }
end
@@ -47,44 +53,69 @@
end
# Write settings dialog
- # @return `abort if aborted and `next otherwise
+ #
+ # @return [Symbol] :next whether configuration is saved successfully
+ # :back if user decided to go back to change settings
+ # :abort otherwise
def WriteDialog
- Builtins.y2milestone("Running write dialog")
- Wizard.RestoreHelp(Ops.get(@HELPS, "write", ""))
- ret = DhcpServer.Write
- if ret && restart_after_writing?
- # Restart only if it's already running
- DhcpServerUI.service.try_restart
- end
- # yes-no popup
- if !ret &&
- Popup.YesNo(
- _("Saving the configuration failed. Change the settings?")
- )
- return :back
- end
- ret ? :next : :abort
+ help_text = @HELPS.fetch("write", "")
+ Wizard.RestoreHelp(help_text)
+
+ return :next if write_settings
+ return :back if back_to_change_setting?
+ :abort
end
# Write settings without quitting
def SaveAndRestart(event)
- return nil unless CWM.validate_current_widgets(event)
- CWM.save_current_widgets(event)
+ return nil unless validate_and_save_widgets(event)
+
+ help_text = @HELPS.fetch("write", "")
Wizard.CreateDialog
- Wizard.RestoreHelp(Ops.get(@HELPS, "write", ""))
- ret = DhcpServer.Write
- if ret
- # Restart only if it's already running
- DhcpServerUI.service.try_restart if restart_after_writing?
- else
- Report.Error(_("Saving the configuration failed"))
- end
- UI.CloseDialog
+ Wizard.RestoreHelp(help_text)
+ Report.Error(_("Saving the configuration failed")) unless write_settings
+ Wizard.CloseDialog
+
+ service_widget.refresh if service
nil
end
+ # Write DHCP server settings and save the service
+ #
+ # @note currently, the DhpcServer is a Perl module, reason why the write of
+ # settings is being performed in two separate steps.
+ #
+ # @return [Boolean] true if settings are saved successfully; false otherwise
+ def write_settings
+ return false unless DhcpServer.Write
+ return true unless service
+
+ service.save(keep_state: Mode.auto)
+ end
+
+ # Shows a popup asking to user if wants to change settings
+ #
+ # @return [Boolean] true if user decides to go back to change settings; false otherwise
+ def back_to_change_setting?
+ change_settings_message = _("Saving the configuration failed. Change the settings?")
+ Yast2::Popup.show(change_settings_message, headline: :warning, buttons: :yes_no) == :yes
+ end
+
+ # Validates and saves CWM widgets
+ #
+ # @param [Hash] event map that triggered saving
+ #
+ # @return [Boolean] true when widgets pass the validaton; false otherwise
+ def validate_and_save_widgets(event)
+ return false unless CWM.validate_current_widgets(event)
+
+ CWM.save_current_widgets(event)
+
+ true
+ end
+
# Run main dialog
# @return [Symbol] for wizard sequencer
def OldMainDialog
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/dialogs2.rb new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/dialogs2.rb
--- old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/dialogs2.rb 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/dialogs2.rb 2018-08-24 17:09:37.000000000 +0200
@@ -80,7 +80,7 @@
@tabs = {
"start_up" => {
"contents" => VBox(
- "service_status",
+ "service_widget",
VSpacing(),
"use_ldap",
VSpacing(),
@@ -97,7 +97,7 @@
# tree item
"tree_item_label" => _("Start-Up"),
"widget_names" => [
- "service_status",
+ "service_widget",
"use_ldap",
"expert_settings",
"other_options",
@@ -171,7 +171,7 @@
"inst_summary" => {
"contents" => VBox(
VSpacing(1),
- "auto_start_up",
+ "service_widget",
VSpacing(1),
"config_summary",
VSpacing(1),
@@ -181,7 +181,7 @@
# dialog caption
"wizard" => _("Start-Up"),
"widget_names" => [
- "auto_start_up",
+ "service_widget",
"config_summary",
"all_settings_button"
]
@@ -192,29 +192,6 @@
Builtins.union(
@widgets,
{
- "auto_start_up" => CWMServiceStart.CreateAutoStartWidget(
- {
- "get_service_auto_start" => fun_ref(
- method(:GetStartService),
- "boolean ()"
- ),
- "set_service_auto_start" => fun_ref(
- method(:SetStartService),
- "void (boolean)"
- ),
- # radio button
- "start_auto_button" => _("When &Booting"),
- # radio button
- "start_manual_button" => _("&Manually"),
- "help" => Builtins.sformat(
- CWMServiceStart.AutoStartHelpTemplate,
- # part of help text - radio button label, NO SHORTCUT!!!
- _("When Booting"),
- # part of help text - radio button label, NO SHORTCUT!!!
- _("Manually")
- )
- }
- ),
"use_ldap" => CWMServiceStart.CreateLdapWidget(
{
"get_use_ldap" => fun_ref(
@@ -2132,16 +2109,6 @@
nil
end
-
- def GetStartService
- DhcpServer.GetStartService
- end
-
- def SetStartService(start)
- DhcpServer.SetStartService(start)
-
- nil
- end
# Common Config Dialog
# @return [Symbol] for the wizard sequencer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/widgets.rb new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/widgets.rb
--- old/yast2-dhcp-server-4.0.2/src/include/dhcp-server/widgets.rb 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/src/include/dhcp-server/widgets.rb 2018-08-24 17:09:37.000000000 +0200
@@ -7,7 +7,9 @@
# Authors: Jiri Srain
require "yast"
-require "ui/service_status"
+require "yast2/system_service"
+require "cwm"
+require "cwm/service_widget"
# Representation of the configuration of dhcp-server.
# Input and output routines.
@@ -27,22 +29,20 @@
Yast.import "TablePopup"
Yast.import "SuSEFirewall"
Yast.import "Mode"
- Yast.import "DhcpServerUI"
end
- # Widget to handle the status of the service
+ # Returns the service for DHCP
#
- # @return [::UI::ServiceStatus] nil if the service is not found (dhcp server
- # not installed)
- def status_widget
- return @status_widget unless @status_widget.nil?
+ # @return [Yast2::SystemService] status service
+ def service
+ @service ||= Yast2::SystemService.find(DhcpServer.ServiceName)
+ end
- service = DhcpServerUI.service
- if service
- @status_widget = ::UI::ServiceStatus.new(service, reload_flag_label: :restart)
- else
- nil
- end
+ # Widget to define status and start mode of the service
+ #
+ # @return [::CWM::ServiceWidget]
+ def service_widget
+ @service_widget ||= ::CWM::ServiceWidget.new(service)
end
# Function for deleting entry from section
@@ -855,47 +855,15 @@
# Handle function for the 'Apply' button
def handle_apply(_key, event)
- event_id = event["ID"]
- if event_id == "apply"
- SaveAndRestart(event)
- end
- nil
- end
+ SaveAndRestart(event) if event["ID"] == "apply"
- def init_service_status(_key)
- # If UI::ServiceStatus is used, do not let DnsServer manage the service
- # status, let the user decide
- DhcpServer.SetWriteOnly(true)
nil
end
- # Handle function for the ServiceStatus widget
- def handle_service_status(_key, event)
- event_id = event["ID"]
- if status_widget.handle_input(event_id) == :enabled_flag
- DhcpServer.SetModified
- end
- nil
- end
-
- # Store settings of the widget
- # @param [String] id string widget id
- # @param [Hash] event map event that caused storing process
- def store_service_status(_key, _event)
- DhcpServer.SetStartService(status_widget.enabled_flag?)
- nil
- end
-
- # Checks if the service must be restarted after saving
- # @return [Boolean]
- def restart_after_writing?
- # If ServiceStatus is used, DhcpServer must be set to write-only
- DhcpServer.GetWriteOnly() && status_widget && status_widget.reload_flag?
- end
-
# Initialize widgets
+ #
# Create description map and copy it into appropriate variable of the
- # DhcpServer module
+ # DhcpServer module
def InitWidgets
options = [
"option subnet-mask",
@@ -1326,16 +1294,30 @@
# it needs the "dhcp-server" package already installed in the system
# otherwise it crashes
def InitServiceWidget
- return if @widgets["service_status"]
+ return if @widgets["service_widget"]
- @widgets["service_status"] = {
- "widget" => :custom,
- "custom_widget" => status_widget.widget,
- "help" => status_widget.help,
- "init" => fun_ref(method(:init_service_status), "void (string)"),
- "handle" => fun_ref(method(:handle_service_status), "symbol (string, map)"),
- "store" => fun_ref(method(:store_service_status), "void (string, map)")
- }
+ @widgets["service_widget"] = service_widget_content
+ end
+
+ private
+
+ # Returns the content to be displayed in the start up section
+ #
+ # Depending on whether the `dhcpd` is installed or not, it will return a
+ #
+ # * ServiceWidget definition (when installed)
+ # * Label with an information message (when not)
+ #
+ # @return [Hash]
+ def service_widget_content
+ if service
+ service_widget.cwm_definition
+ else
+ {
+ "widget" => :custom,
+ "custom_widget" => Left(Label(_("Service dhcpd is not installed")))
+ }
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/src/modules/DhcpServer.pm new/yast2-dhcp-server-4.1.2/src/modules/DhcpServer.pm
--- old/yast2-dhcp-server-4.0.2/src/modules/DhcpServer.pm 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/src/modules/DhcpServer.pm 2018-08-24 17:09:37.000000000 +0200
@@ -1745,33 +1745,6 @@
SCR->Write (".sysconfig.dhcpd.DHCPD_INTERFACE", $ifaces_list);
SCR->Write (".sysconfig.dhcpd.DHCPD_OTHER_ARGS", $other_options);
SCR->Write (".sysconfig.dhcpd", undef);
-
-
- if ($start_service)
- {
- y2milestone ("Enabling the DHCP service");
- my $ret = 1;
- if (! $write_only)
- {
- $ret = Service->Restart ($SERVICE);
- }
- Service->Enable ($SERVICE);
- if (!$ret)
- {
- # error report
- Report->Error (__("Error occurred while restarting the DHCP daemon."));
- $ok = 0;
- }
- }
- else
- {
- y2milestone ("Disabling the DHCP service");
- if (! $write_only)
- {
- Service->Stop ($SERVICE);
- }
- Service->Disable ($SERVICE);
- }
Progress->NextStage ();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dhcp-server-4.0.2/src/modules/DhcpServerUI.rb new/yast2-dhcp-server-4.1.2/src/modules/DhcpServerUI.rb
--- old/yast2-dhcp-server-4.0.2/src/modules/DhcpServerUI.rb 2018-08-03 15:02:10.000000000 +0200
+++ new/yast2-dhcp-server-4.1.2/src/modules/DhcpServerUI.rb 2018-08-24 17:09:37.000000000 +0200
@@ -22,9 +22,7 @@
Yast.import "Mode"
Yast.import "Popup"
Yast.import "Report"
- Yast.import "Service"
Yast.import "SuSEFirewall"
- Yast.import "SystemdService"
@current_entry_type = ""
@current_entry_id = ""
@@ -82,13 +80,6 @@
nil
end
- # Object representing the DHCP service for its usage in the UI code
- #
- # @return [Yast::SystemdServiceClass::Service]
- def service
- @service ||= SystemdService.find(DhcpServer.ServiceName())
- end
-
publish :variable => :current_entry_type, :type => "string"
publish :variable => :current_entry_id, :type => "string"
publish :variable => :current_entry_options, :type => "list