ref: refs/heads/master
commit d4164b29aaaa51174bd80545a30acea4dbeb6a50
Author: Michal Zugec
Date: Tue Aug 25 17:09:28 2009 +0200
Revert "Revert "introduction to use dbus service""
This reverts commit 0632b0433e70ea0c78ff55af730e6b41276a6ff5.
---
.../network/app/controllers/networks_controller.rb | 2 +-
plugins/network/app/models/network.rb | 25 ++++++++++++--------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/plugins/network/app/controllers/networks_controller.rb b/plugins/network/app/controllers/networks_controller.rb
index 91ee181..46d9086 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, "user not found") and return
+ render ErrorResult.error(404, 2, "device not found") and return
end
end
diff --git a/plugins/network/app/models/network.rb b/plugins/network/app/models/network.rb
index c893a2e..8842492 100644
--- a/plugins/network/app/models/network.rb
+++ b/plugins/network/app/models/network.rb
@@ -21,17 +21,22 @@ class Network
def Network.find_all()
- 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
+ ret = Network.new()
+# ret.parse_response YastService.Call("YaPI::NETWORK::Read")
+ return YastService.Call("YaPI::NETWORK::Read")
+# return ret
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@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org