Skip to content

Commit

Permalink
Merge 8584427 into 9088160
Browse files Browse the repository at this point in the history
  • Loading branch information
teclator committed Sep 23, 2019
2 parents 9088160 + 8584427 commit 5091ab1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 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.2.4

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

Expand Down
4 changes: 2 additions & 2 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 @@ -17,7 +17,7 @@


Name: yast2-dns-server
Version: 4.2.3
Version: 4.2.4
Release: 0
Url: https://github.com/yast/yast-dns-server
Summary: YaST2 - DNS Server Configuration
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 5091ab1

Please sign in to comment.