ref: refs/heads/network
commit 1a7aa027d5e8125492477710d118faac36126cbb
Author: Michal Zugec
Date: Tue Sep 29 11:08:10 2009 +0200
improved if condition to be more readable
---
.../network/app/controllers/network_controller.rb | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/plugins/network/app/controllers/network_controller.rb b/plugins/network/app/controllers/network_controller.rb
index 8c82060..36afecb 100644
--- a/plugins/network/app/controllers/network_controller.rb
+++ b/plugins/network/app/controllers/network_controller.rb
@@ -51,7 +51,11 @@ class NetworkController < ApplicationController
end
@ip, @netmask = ipaddr.split "/"
# when detect PREFIXLEN with leading "/"
- @netmask = "/"+@netmask if ifc.bootproto == "static" && @netmask.to_i >= 0 && @netmask.to_i <= 32
+ NETMASK_RANGE = 0..32
+ 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
@name = hn.name
@domain = hn.domain
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org