Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <web-client> network : improved if condition to be more readable
  • From: Michal Zugec <mzugec@xxxxxxx>
  • Date: Tue, 29 Sep 2009 11:08:10 +0200
  • Message-id: <E1MsYiH-00038U-D6@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit 1a7aa027d5e8125492477710d118faac36126cbb
Author: Michal Zugec <mzugec@xxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages