diff --git a/package/autoyast2.changes b/package/autoyast2.changes index 036b49706..4239b70a5 100644 --- a/package/autoyast2.changes +++ b/package/autoyast2.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Sep 7 07:27:53 UTC 2016 - igonzalezsosa@suse.com + +- Fix IP detection in AutoYaST installation rules + in order to find the correct profile when "ip route" + mentions "metric" (bnc#997548). +- 3.1.150 + ------------------------------------------------------------------- Fri Aug 26 09:39:55 UTC 2016 - kanderssen@suse.com diff --git a/package/autoyast2.spec b/package/autoyast2.spec index 46f61c2c6..93f3fe572 100644 --- a/package/autoyast2.spec +++ b/package/autoyast2.spec @@ -17,7 +17,7 @@ Name: autoyast2 -Version: 3.1.149 +Version: 3.1.150 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff --git a/src/modules/AutoInstallRules.rb b/src/modules/AutoInstallRules.rb index 779129840..2ae45cd29 100644 --- a/src/modules/AutoInstallRules.rb +++ b/src/modules/AutoInstallRules.rb @@ -1111,14 +1111,17 @@ def AutoInstallRules nil end + # Regexp to extract the IP from the routes table + HOSTADDRESS_REGEXP = /src ([\w.]+) /.freeze + # Return the IP through iproute2 tools # # @return [String] IP address def hostaddress return @hostaddress unless @hostaddress.nil? ip_route = SCR.Execute(path(".target.bash_output"), "/usr/sbin/ip route") - regexp = /src ([\w.]+) \n/ - if ret = ip_route["stdout"][regexp, 1] + if ret = ip_route["stdout"][HOSTADDRESS_REGEXP, 1] + log.info "Found IP address: #{ret}" ret else log.warn "Cannot evaluate IP address: #{ip_route}" diff --git a/test/fixtures/output/ip_route.out b/test/fixtures/output/ip_route.out index bf2ff26e8..c28c69538 100644 --- a/test/fixtures/output/ip_route.out +++ b/test/fixtures/output/ip_route.out @@ -1,3 +1,4 @@ -10.13.32.0/24 dev eth0 proto kernel scope link src 10.13.32.195 +default via 10.13.32.1 dev eth0 proto dhcp +10.13.32.0/24 dev eth0 proto kernel scope link src 10.13.32.195 metric 600 10.163.0.1 dev tun0 proto kernel scope link src 10.163.0.6 -10.163.2.0/28 dev eth1 proto kernel scope link src 10.163.2.1 +10.163.2.0/28 dev eth1 proto kernel scope link src 10.163.2.1 \ No newline at end of file