Skip to content

Commit

Permalink
Merge 100a9e8 into dfc69a9
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Sep 23, 2019
2 parents dfc69a9 + 100a9e8 commit 8d44464
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 7 deletions.
7 changes: 7 additions & 0 deletions package/yast2-dns-server.changes
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Sep 23 07:12:04 UTC 2019 - Knut Anderssen <kanderssen@suse.com>

- Permit the user to force an netconfig update when netconfig was
not able to change the configuration. (bsc#1123985)
- 4.1.4

-------------------------------------------------------------------
Fri Sep 20 14:12:10 UTC 2019 - Knut Anderssen <kanderssen@suse.com>

Expand Down
6 changes: 3 additions & 3 deletions package/yast2-dns-server.spec
@@ -1,7 +1,7 @@
#
# spec file for package yast2-dns-server
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -12,12 +12,12 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name: yast2-dns-server
Version: 4.1.3
Version: 4.1.4
Release: 0
Url: https://github.com/yast/yast-dns-server

Expand Down
23 changes: 19 additions & 4 deletions src/modules/DnsServer.pm
Expand Up @@ -1260,6 +1260,20 @@ sub GetWhichZonesAreConnectedWith {
return \@ret;
}

sub netconfig_update_dns {
my $force_update = shift;
my $cmd = "/sbin/netconfig".($force_update ? " -f":"")." update -m dns";

y2milestone("Updating forwarders by netconfig");

my $ret = SCR->Execute (".target.bash_output", $cmd);
if ($ret->{'exit'} != 0) {
Report->Error (sformat(__("Error occurred while calling netconfig.\nError: %1"), $ret->{'stdout'}));
}

return $ret->{'exit'};
}

# Writes forwarding settings and updates the system using netconfig.
# This also automatically updates /etc/named.d/forwarders.conf
sub write_local_forwarder {
Expand All @@ -1269,10 +1283,11 @@ sub write_local_forwarder {
SCR->Write (".sysconfig.network.config.NETCONFIG_DNS_FORWARDER", GetLocalForwarder());
SCR->Write (".sysconfig.network.config", undef);

y2milestone("Updating forwarders by netconfig");
my $ret = SCR->Execute (".target.bash_output", "/sbin/netconfig update -m dns");
if ($ret->{'exit'} != 0) {
Report->Error (__("Error occurred while calling netconfig.\nError: ".$ret->{'stdout'}));
my $netconfig_dns_updated = netconfig_update_dns(0);

if ($netconfig_dns_updated == 20) {
my $retry = Popup->YesNo (__("Do you want to force an update now?"));
netconfig_update_dns(1) if ($retry);
}
}

Expand Down

0 comments on commit 8d44464

Please sign in to comment.