Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] <rest-service> network : Don't add broken code to master, add it to branch.
  • From: Josef Reidinger <jreidinger@xxxxxxx>
  • Date: Thu, 27 Aug 2009 10:33:46 +0200
  • Message-id: <E1MiTqO-0006hZ-OD@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit e742d756051b809a1da85721f16454f12271d742
Author: Josef Reidinger <jreidinger@xxxxxxx>
Date: Thu Aug 27 10:33:46 2009 +0200

Don't add broken code to master, add it to branch.

This reverts commit d4164b29aaaa51174bd80545a30acea4dbeb6a50.
---
.../network/app/controllers/networks_controller.rb | 2 +-
plugins/network/app/models/network.rb | 25 ++++++++------------
2 files changed, 11 insertions(+), 16 deletions(-)

diff --git a/plugins/network/app/controllers/networks_controller.rb
b/plugins/network/app/controllers/networks_controller.rb
index 46d9086..91ee181 100644
--- a/plugins/network/app/controllers/networks_controller.rb
+++ b/plugins/network/app/controllers/networks_controller.rb
@@ -77,7 +77,7 @@ class NetworksController < ApplicationController
render ErrorResult.error(404, 2, "empty parameter") and return
end
unless get_device params[:id]
- render ErrorResult.error(404, 2, "device not found") and return
+ render ErrorResult.error(404, 2, "user not found") and return
end
end

diff --git a/plugins/network/app/models/network.rb
b/plugins/network/app/models/network.rb
index 8842492..c893a2e 100644
--- a/plugins/network/app/models/network.rb
+++ b/plugins/network/app/models/network.rb
@@ -21,22 +21,17 @@ class Network


def Network.find_all()
- ret = Network.new()
-# ret.parse_response YastService.Call("YaPI::NETWORK::Read")
- return YastService.Call("YaPI::NETWORK::Read")
-# return ret
+ ret = Scr.instance.execute(["/sbin/yast2", "lan", "list"])
+ lines = ret[:stderr].split "\n"
+ devices = []
+ lines.each do |s|
+ dev = Network.new
+ dev.id = s.split("\t")[0]
+ dev.name = s.split("\t")[1]
+ devices << dev
+ end
+ return devices
end
-# ret = Scr.instance.execute(["/sbin/yast2", "lan", "list"])
-# lines = ret[:stderr].split "\n"
-# devices = []
-# lines.each do |s|
-# dev = Network.new
-# dev.id = s.split("\t")[0]
-# dev.name = s.split("\t")[1]
-# devices << dev
-# end
-# return devices
-# end


def to_xml( options = {} )
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages