Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] <rest-service> network : Revert "introduction to use dbus service"
  • From: Michal Zugec <mzugec@xxxxxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 25 Aug 2009 17:06:47 +0200
  • Message-id: <E1MiTqN-0006fj-6s@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit 0632b0433e70ea0c78ff55af730e6b41276a6ff5
Author: Michal Zugec <mzugec@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue Aug 25 17:06:47 2009 +0200

Revert "introduction to use dbus service"

This reverts commit a365f79435c00ce7fc5d155ca346655997804b09.
---
.../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