Mailinglist Archive: yast-commit (1771 mails)

< Previous Next >
[yast-commit] <rest-service> network : introduction to use dbus service
  • From: Michal Zugec <mzugec@xxxxxxxxxxxxxxxxxxxxxxxxxx>
  • Date: Tue, 25 Aug 2009 00:02:44 +0200
  • Message-id: <E1MiTqM-0006eW-5B@xxxxxxxxxxxxxxxx>
ref: refs/heads/network
commit a365f79435c00ce7fc5d155ca346655997804b09
Author: Michal Zugec <mzugec@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue Aug 25 00:02:44 2009 +0200

introduction to use dbus service
---
.../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@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages