Hello community, here is the log from the commit of package yast2-dns-server for openSUSE:Factory checked in at 2018-06-04 13:23:01 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-dns-server (Old) and /work/SRC/openSUSE:Factory/.yast2-dns-server.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-dns-server" Mon Jun 4 13:23:01 2018 rev:72 rq:613935 version:4.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-dns-server/yast2-dns-server.changes 2018-01-30 15:45:15.236223305 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-dns-server.new/yast2-dns-server.changes 2018-06-04 13:23:57.985464700 +0200 @@ -1,0 +2,7 @@ +Wed May 30 09:45:34 CEST 2018 - schubi@suse.de + +- Reload named.service only if it is running, otherwise restart it. + (bnc#1093029) +- 4.0.2 + +------------------------------------------------------------------- Old: ---- yast2-dns-server-4.0.1.tar.bz2 New: ---- yast2-dns-server-4.0.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-dns-server.spec ++++++ --- /var/tmp/diff_new_pack.uf7FtU/_old 2018-06-04 13:23:58.533444633 +0200 +++ /var/tmp/diff_new_pack.uf7FtU/_new 2018-06-04 13:23:58.533444633 +0200 @@ -17,7 +17,7 @@ Name: yast2-dns-server -Version: 4.0.1 +Version: 4.0.2 Release: 0 Url: https://github.com/yast/yast-dns-server ++++++ yast2-dns-server-4.0.1.tar.bz2 -> yast2-dns-server-4.0.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dns-server-4.0.1/package/yast2-dns-server.changes new/yast2-dns-server-4.0.2/package/yast2-dns-server.changes --- old/yast2-dns-server-4.0.1/package/yast2-dns-server.changes 2018-01-30 13:37:03.000000000 +0100 +++ new/yast2-dns-server-4.0.2/package/yast2-dns-server.changes 2018-06-04 10:59:02.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed May 30 09:45:34 CEST 2018 - schubi@suse.de + +- Reload named.service only if it is running, otherwise restart it. + (bnc#1093029) +- 4.0.2 + +------------------------------------------------------------------- Thu Jan 25 15:26:18 UTC 2018 - knut.anderssen@suse.com - Replace SuSEFirewall2 by firewalld (fate#323460) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dns-server-4.0.1/package/yast2-dns-server.spec new/yast2-dns-server-4.0.2/package/yast2-dns-server.spec --- old/yast2-dns-server-4.0.1/package/yast2-dns-server.spec 2018-01-30 13:37:03.000000000 +0100 +++ new/yast2-dns-server-4.0.2/package/yast2-dns-server.spec 2018-06-04 10:59:02.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-dns-server -Version: 4.0.1 +Version: 4.0.2 Release: 0 Url: https://github.com/yast/yast-dns-server diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dns-server-4.0.1/src/include/dns-server/dialog-main.rb new/yast2-dns-server-4.0.2/src/include/dns-server/dialog-main.rb --- old/yast2-dns-server-4.0.1/src/include/dns-server/dialog-main.rb 2018-01-30 13:37:03.000000000 +0100 +++ new/yast2-dns-server-4.0.2/src/include/dns-server/dialog-main.rb 2018-06-04 10:59:02.000000000 +0200 @@ -1881,7 +1881,13 @@ Wizard.RestoreHelp(Ops.get_string(@HELPS, "write", "")) ret = DnsServer.Write if ret - service.reload if status_widget.reload_flag? + if status_widget.reload_flag? + if service.running? + service.reload + else + service.restart + end + end :next else if Popup.YesNo(_("Saving the configuration failed. Change the settings?")) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-dns-server-4.0.1/test/main_test.rb new/yast2-dns-server-4.0.2/test/main_test.rb --- old/yast2-dns-server-4.0.1/test/main_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-dns-server-4.0.2/test/main_test.rb 2018-06-04 10:59:02.000000000 +0200 @@ -0,0 +1,45 @@ +#! /usr/bin/env rspec + +require_relative "test_helper" +require "yast" +require "yast/rspec" + +describe "DnsServerDialogMainInclude" do + class CurrentDialogMain + include Yast::I18n + include Yast::UIShortcuts + + attr_accessor :status_widget + attr_accessor :service + def initialize + Yast.include self, "dns-server/dialog-main.rb" + @status_widget = "status_widget" + @service = "named.service" + end + end + + before do + allow_any_instance_of(CurrentDialogMain).to receive(:fun_ref) + end + + describe "#WriteDialog" do + it "reloads running named.service" do + m = CurrentDialogMain.new + expect(Yast::DnsServer).to receive(:Write).and_return true + expect(m.service).to receive(:running?).and_return true + expect(m.status_widget).to receive(:reload_flag?).and_return true + expect(m.service).to receive(:reload) + expect(m.WriteDialog ).to eq(:next) + end + + it "restarts not running named.service" do + m = CurrentDialogMain.new + expect(Yast::DnsServer).to receive(:Write).and_return true + expect(m.service).to receive(:running?).and_return false + expect(m.status_widget).to receive(:reload_flag?).and_return true + expect(m.service).to receive(:restart) + expect(m.WriteDialog ).to eq(:next) + end + end + +end