Mailinglist Archive: yast-commit (2114 mails)

< Previous Next >
[yast-commit] <rest-service> resource-restful : network: save interfaces
  • From: Michal Zugec <mzugec@xxxxxxx>
  • Date: Wed, 16 Sep 2009 14:57:13 +0200
  • Message-id: <E1Mq44G-00088J-Vv@xxxxxxxxxxxxxxxx>
ref: refs/heads/resource-restful
commit c57d99f59f6e60e5958ea2309286f738ed21c62a
Author: Michal Zugec <mzugec@xxxxxxx>
Date: Wed Sep 16 14:57:13 2009 +0200

network: save interfaces
---
.../controllers/network/interfaces_controller.rb | 14 +++++++-------
plugins/network/app/models/interface.rb | 3 ++-
2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/plugins/network/app/controllers/network/interfaces_controller.rb
b/plugins/network/app/controllers/network/interfaces_controller.rb
index bc71feb..5571039 100644
--- a/plugins/network/app/controllers/network/interfaces_controller.rb
+++ b/plugins/network/app/controllers/network/interfaces_controller.rb
@@ -15,13 +15,13 @@ class Network::InterfacesController < ApplicationController
end

@iface = Interface.new(root)
- @iface.save
- render :show
- end
-
- # See update
- def create
- update
+ respond_to do |format|
+ if @iface.save
+ format.xml { head :ok }
+ else
+ format.xml { render :xml => @iface.errors, :status =>
:unprocessable_entity }
+ end
+ end
end

# Shows hostname settings. Requires read permission for network YaPI.
diff --git a/plugins/network/app/models/interface.rb
b/plugins/network/app/models/interface.rb
index 1d6c293..d28c5b8 100644
--- a/plugins/network/app/models/interface.rb
+++ b/plugins/network/app/models/interface.rb
@@ -42,7 +42,8 @@ class Interface
"ipaddr" => @ipaddr
}
}
- YastService.Call("YaPI::NETWORK::Write",{"interface" => settings})
+ vsettings = [ "a{sa{ss}}", settings ] # bnc#538050
+ YastService.Call("YaPI::NETWORK::Write",{"interface" => vsettings})
# TODO success or not?
end

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages