diff --git a/package/yast2-dhcp-server.changes b/package/yast2-dhcp-server.changes index 1e7e55e..5ae33ed 100644 --- a/package/yast2-dhcp-server.changes +++ b/package/yast2-dhcp-server.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Jan 26 13:14:57 UTC 2016 - mvidner@suse.com + +- Fix "One or more selected network interfaces is not configured" + when ifconfig is not installed (boo#958525). +- 3.1.10 + ------------------------------------------------------------------- Thu Jan 14 15:46:22 UTC 2016 - igonzalezsosa@suse.com diff --git a/package/yast2-dhcp-server.spec b/package/yast2-dhcp-server.spec index 265d894..c49e6b4 100644 --- a/package/yast2-dhcp-server.spec +++ b/package/yast2-dhcp-server.spec @@ -17,7 +17,7 @@ Name: yast2-dhcp-server -Version: 3.1.9 +Version: 3.1.10 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/include/dhcp-server/commandline.rb b/src/include/dhcp-server/commandline.rb index a33a19a..17390c9 100644 --- a/src/include/dhcp-server/commandline.rb +++ b/src/include/dhcp-server/commandline.rb @@ -133,12 +133,6 @@ def initialize_dhcp_server_commandline(include_target) ), "type" => "string" }, - "list" => { - # command line help text for an option - "help" => _( - "List all defined hosts with a fixed address" - ) - }, "select" => { # command line help text for an option "help" => _( diff --git a/src/include/dhcp-server/dialogs.rb b/src/include/dhcp-server/dialogs.rb index 76c63e9..a931081 100644 --- a/src/include/dhcp-server/dialogs.rb +++ b/src/include/dhcp-server/dialogs.rb @@ -300,7 +300,6 @@ def PoolDialog Wizard.RestoreAbortButton return CWM.Run(w, @functions) - :back end # Run group dialog @@ -369,7 +368,6 @@ def ClassDialog Wizard.RestoreAbortButton return CWM.Run(w, @functions) - :back end # Run shared network dialog @@ -382,9 +380,9 @@ def SectionTypeChoose while par_id != "" parents = Builtins.add(parents, par_type) - p = DhcpServer.GetEntryParent(par_type, par_id) - par_type = Ops.get(p, "type", "") - par_id = Ops.get(p, "id", "") + par = DhcpServer.GetEntryParent(par_type, par_id) + par_type = Ops.get(par, "type", "") + par_id = Ops.get(par, "id", "") end possible = ["subnet", "host", "shared-network", "group", "pool", "class"] if Builtins.contains(parents, "class") || diff --git a/src/include/dhcp-server/dialogs2.rb b/src/include/dhcp-server/dialogs2.rb index 7691303..b404aba 100644 --- a/src/include/dhcp-server/dialogs2.rb +++ b/src/include/dhcp-server/dialogs2.rb @@ -380,8 +380,6 @@ def time2seconds(count, unit) end def seconds2time(seconds) - unit = "seconds" - count = seconds if Ops.modulo(seconds, 60 * 60 * 24) == 0 return { "unit" => "days", @@ -942,9 +940,6 @@ def GlobalSettingsValidate(key, event) timeserver = Convert.to_string(UI.QueryWidget(Id("timeserver"), :Value)) printserver = Convert.to_string(UI.QueryWidget(Id("printserver"), :Value)) winsserver = Convert.to_string(UI.QueryWidget(Id("winsserver"), :Value)) - defaultleasetime = Convert.to_string( - UI.QueryWidget(Id("defaultleasetime"), :Value) - ) # FIXME: it is not defined which of values must be filled (must be lease time defined?) # shouldn't be lease time controlled for too small or too big value? @@ -1491,12 +1486,6 @@ def DynamicDHCPValidate(key, event) event = deep_copy(event) from_ip = Convert.to_string(UI.QueryWidget(Id("from_ip"), :Value)) to_ip = Convert.to_string(UI.QueryWidget(Id("to_ip"), :Value)) - defaultleasetime = Convert.to_string( - UI.QueryWidget(Id("defaultleasetime"), :Value) - ) - maxleasetime = Convert.to_string( - UI.QueryWidget(Id("maxleasetime"), :Value) - ) if from_ip == "" && to_ip == "" # disable dynamic IP assigning diff --git a/src/include/dhcp-server/dns-server-management.rb b/src/include/dhcp-server/dns-server-management.rb index 3b91751..4b15962 100644 --- a/src/include/dhcp-server/dns-server-management.rb +++ b/src/include/dhcp-server/dns-server-management.rb @@ -102,7 +102,6 @@ def RemoveDNSRangeWorker(first_ip, last_ip) zone_counter = -1 zone_found = false - filtered_zone = {} Builtins.foreach(all_zones) do |one_zone| zone_counter = Ops.add(zone_counter, 1) if Ops.get(one_zone, "zone") == zone_name @@ -629,7 +628,6 @@ def SetZoneRecords(zone_name, new_records) return nil end - ret = nil all_records = DnsServer.FetchZones zone_counter = -1 diff --git a/src/include/dhcp-server/helps.rb b/src/include/dhcp-server/helps.rb index 5ae17a1..7c2a6e7 100644 --- a/src/include/dhcp-server/helps.rb +++ b/src/include/dhcp-server/helps.rb @@ -223,12 +223,6 @@ def initialize_dhcp_server_helps(include_target) "To enter the complete configuration of the DHCP server, click\n" + "DHCP Server Expert Configuration.

" ), - # help text 1/2 - "interfaces" => _( - "

Network Interfaces
\n" + - "Select the network interfaces to which the DHCP server should listen from\n" + - "Available Interfaces.

" - ), # host management help 1/3 "host_management" => _( "

Host Management
\nUse this dialog to edit hosts with static address binding.

" diff --git a/src/include/dhcp-server/options.rb b/src/include/dhcp-server/options.rb index c154354..57c5eeb 100644 --- a/src/include/dhcp-server/options.rb +++ b/src/include/dhcp-server/options.rb @@ -159,7 +159,6 @@ def initialize_dhcp_server_options(include_target) "pid-file-name" => "name", "ping-check" => "onoff", "ping-timeout" => "seconds", - "ping-timeout" => "seconds", "server-identifier" => "hostname", "server-name" => "name", "site-option-space" => "name", diff --git a/src/include/dhcp-server/wizards.rb b/src/include/dhcp-server/wizards.rb index 234b204..baaf981 100644 --- a/src/include/dhcp-server/wizards.rb +++ b/src/include/dhcp-server/wizards.rb @@ -63,8 +63,7 @@ def MainSequence "section_type_select" => [lambda { SelectEditationDialog() }, true], "store" => [lambda { SectionStore() }, true], "tsig_keys" => lambda { RunTsigKeysDialog(false) }, - "tsig_keys_1" => lambda { RunTsigKeysDialog(true) }, - "commonsetup" => lambda { CommonConfigDialog() } + "tsig_keys_1" => lambda { RunTsigKeysDialog(true) } } sequence = { diff --git a/src/modules/DhcpServer.pm b/src/modules/DhcpServer.pm index d6b831d..1936923 100644 --- a/src/modules/DhcpServer.pm +++ b/src/modules/DhcpServer.pm @@ -2267,27 +2267,29 @@ sub GetInterfaceInformation { #} #my $iface = $out{"stdout"}; + # sample output: + # 9: virbr0 inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0\ valid_lft forever preferred_lft forever my %out = %{SCR->Execute (".target.bash_output", - "LANG=en_EN /sbin/ifconfig $interface") || {}}; + "LANG=C ip -4 -oneline addr show dev $interface") || {}}; if ($out{"exit"} != 0) { - y2error ("ifconfig exited with code $out{\"exit\"}"); + y2error ("'ip addr' exited with code $out{\"exit\"}"); return {}; } my @lines = split /\n/, $out{"stdout"}; - @lines = grep /inet addr:.*Bcast:.*Mask:.*/, @lines; + @lines = grep /inet .* brd .*/, @lines; my $line = $lines[0] || ""; - if ($line =~ /inet addr:[ \t]*([0-9\.]+)[ \t]*Bcast:[ \t]*([0-9\.]+)[ \t]*Mask:[ \t]*([0-9\.]+)[ \t]*$/) + if ($line =~ /inet[ \t]*([0-9\.]+)\/([0-9\.]+)[ \t]*brd[ \t]*([0-9\.]+)/) { $ip = $1; - $bcast = $2; - $netmask = $3; + $netmask = Netmask->FromBits($2); + $bcast = $3; } - else + else { chomp($interface); - y2warning ("ifconfig didn't return meaningful data about $interface, asking NetworkInterfaces"); + y2warning ("'ip addr' didn't return meaningful data about $interface, asking NetworkInterfaces"); $ip = NetworkInterfaces->GetValue($interface, "IPADDR"); $bcast = NetworkInterfaces->GetValue($interface, "BROADCAST"); $netmask = NetworkInterfaces->GetValue($interface, "NETMASK");