ref: refs/heads/master
commit f68db75fcbbfefd10cb091c5236dd1bee4a4a5e0
Author: Martin Vidner
Date: Thu Nov 5 13:04:57 2009 +0100
Fixed 'undefined variable netmask' for static configs (bnc#552840).
---
.../network/app/controllers/network_controller.rb | 2 +-
.../test/functional/network_controller_test.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/network/app/controllers/network_controller.rb b/plugins/network/app/controllers/network_controller.rb
index 2e63890..2d628c0 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -53,7 +53,7 @@ class NetworkController < ApplicationController
end
@ip, @netmask = ipaddr.split "/"
# when detect PREFIXLEN with leading "/"
- if ifc.bootproto == "static" && NETMASK_RANGE.include?(netmask.to_i)
+ if ifc.bootproto == "static" && NETMASK_RANGE.include?(@netmask.to_i)
@netmask = "/"+@netmask
end
# @netmask = "/"+@netmask if ifc.bootproto == "static" && @netmask.to_i >= 0 && @netmask.to_i <= 32
diff --git a/plugins/network/test/functional/network_controller_test.rb b/plugins/network/test/functional/network_controller_test.rb
index bcdf871..f71fd2e 100644
--- a/plugins/network/test/functional/network_controller_test.rb
+++ b/plugins/network/test/functional/network_controller_test.rb
@@ -41,7 +41,7 @@ class NetworkControllerTest < ActionController::TestCase
@if_proxy = ProxyH.new
@if_proxy.result = {
:all => [ OpenStruct.new("id" => "eth1") ],
- "eth1" => OpenStruct.new("id" => "eth1", "ipaddr" => '10.20.30.42/24')
+ "eth1" => OpenStruct.new("id" => "eth1", "ipaddr" => '10.20.30.42/24', "bootproto" => "static")
}
@hn_proxy = Proxy1.new
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org