Hello community,

here is the log from the commit of package webyast-network-ws for 
openSUSE:Factory
checked in at Wed May 4 11:01:55 CEST 2011.



--------
--- webyast-network-ws/webyast-network-ws.changes       2011-02-09 
09:18:49.000000000 +0100
+++ /mounts/work_src_done/STABLE/webyast-network-ws/webyast-network-ws.changes  
2011-05-02 14:36:15.000000000 +0200
@@ -1,0 +2,19 @@
+Mon May  2 12:34:35 UTC 2011 - [email protected]
+
+- adapt caching to the new job handling
+- 0.2.4
+
+-------------------------------------------------------------------
+Tue Apr 12 13:18:01 UTC 2011 - [email protected]
+
+- new caching
+- 0.2.3 
+
+-------------------------------------------------------------------
+Mon Mar 28 13:49:35 UTC 2011 - [email protected]
+
+- undefined method `bootproto' for #<Interface:0xb67416c8> (bnc#645231) 
+- setting DHCP mode doesn't work for interface eth1
+- 0.2.2
+
+-------------------------------------------------------------------

calling whatdependson for head-i586


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ webyast-network-ws.spec ++++++
--- /var/tmp/diff_new_pack.ulFCMD/_old  2011-05-04 11:01:31.000000000 +0200
+++ /var/tmp/diff_new_pack.ulFCMD/_new  2011-05-04 11:01:31.000000000 +0200
@@ -28,7 +28,7 @@
 Group:          Productivity/Networking/Web/Utilities
 Url:            http://en.opensuse.org/Portal:WebYaST
 AutoReqProv:    on
-Version:        0.2.1
+Version:        0.2.4
 Release:        1
 Summary:        WebYaST - Network service
 Source:         www.tar.bz2


++++++ www.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/app/controllers/network/dns_controller.rb 
new/www/app/controllers/network/dns_controller.rb
--- old/www/app/controllers/network/dns_controller.rb   2010-08-27 
14:58:55.000000000 +0200
+++ new/www/app/controllers/network/dns_controller.rb   2011-04-11 
12:49:05.000000000 +0200
@@ -37,7 +37,7 @@
     root["searches"] = (root["searches"] || "").split
     root["nameservers"] = (root["nameservers"] || "").split
     
-    @dns = DNS.new(root)
+    @dns = Dns.new(root)
     @dns.save!
     show
   end
@@ -49,7 +49,7 @@
 
   # Shows hostname settings. Requires read permission for network YaPI.
   def show
-    @dns = DNS.find
+    @dns = Dns.find
 
     respond_to do |format|
       format.xml { render :xml => @dns.to_xml( :root => "dns", :dasherize => 
false ) }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/app/models/dns.rb new/www/app/models/dns.rb
--- old/www/app/models/dns.rb   2011-02-01 10:49:11.000000000 +0100
+++ new/www/app/models/dns.rb   2011-04-29 18:23:25.000000000 +0200
@@ -18,11 +18,12 @@
 # To contact Novell about this file by physical or electronic mail,
 # you may find current contact information at www.novell.com
 #++
-# = DNS model
+# = Dns model
 # Provides set and gets resources from YaPI network module.
 # Main goal is handle YaPI specific calls and data formats. Provides cleaned
 # and well defined data.
-class DNS < BaseModel::Base
+
+class Dns < BaseModel::Base
 
   # the short hostname
   attr_accessor :searches
@@ -54,9 +55,11 @@
   # fills time instance with data from YaPI.
   #
   # +warn+: Doesn't take any parameters.
-  def DNS.find
-    response = YastService.Call("YaPI::NETWORK::Read") # hostname: true
-    ret = DNS.new response["dns"]
+  def Dns.find
+    YastCache.fetch(self) {
+      response = YastService.Call("YaPI::NETWORK::Read") # hostname: true
+      ret = Dns.new response["dns"]
+    }
   end
 
   # Saves data from model to system via YaPI. Saves only setted data,
@@ -69,6 +72,7 @@
     vsettings = [ "a{sas}", settings ] # bnc#538050    
     YastService.Call("YaPI::NETWORK::Write",{"dns" => vsettings})
     # TODO success or not?
+    YastCache.reset(self)
   end
 
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/app/models/hostname.rb 
new/www/app/models/hostname.rb
--- old/www/app/models/hostname.rb      2011-02-01 10:49:11.000000000 +0100
+++ new/www/app/models/hostname.rb      2011-04-29 18:23:25.000000000 +0200
@@ -22,6 +22,7 @@
 # Provides set and gets resources from YaPI network module.
 # Main goal is handle YaPI specific calls and data formats. Provides cleaned
 # and well defined data.
+
 class Hostname < BaseModel::Base
 
   # the short hostname
@@ -36,8 +37,10 @@
   #
   # +warn+: Doesn't take any parameters.
   def self.find
-    response = YastService.Call("YaPI::NETWORK::Read") # hostname: true
-    Hostname.new response["hostname"]
+    YastCache.fetch(self) {  
+      response = YastService.Call("YaPI::NETWORK::Read") # hostname: true
+      Hostname.new response["hostname"]
+    }
   end
 
   # Saves data from model to system via YaPI. Saves only setted data,
@@ -52,6 +55,7 @@
     vsettings = [ "a{ss}", settings ] # bnc#538050
     YastService.Call("YaPI::NETWORK::Write",{"hostname" => vsettings})
     # TODO success or not?
+    YastCache.reset(self)
   end
 
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/app/models/interface.rb 
new/www/app/models/interface.rb
--- old/www/app/models/interface.rb     2011-02-01 10:49:11.000000000 +0100
+++ new/www/app/models/interface.rb     2011-05-02 11:48:18.000000000 +0200
@@ -22,6 +22,7 @@
 # Provides set and gets resources from YaPI network module.
 # Main goal is handle YaPI specific calls and data formats. Provides cleaned
 # and well defined data.
+
 class Interface < BaseModel::Base
 
   IPADDR_REGEX = /([0-9]{1,3}.){3}[0-9]{1,3}/
@@ -40,24 +41,27 @@
   def initialize(args, id=nil)
     super args
     @id ||= id
-    @ipaddr ||= ""
+    #@ipaddr ||= "" causes exception if bootproto=dhcp: "Raised resource 
Invalid exception - #<InvalidParameters: Invalid arguments: 
{:ipaddr=>:invalid}>"
+    @ipaddr = bootproto == "dhcp" ?  "" : ipaddr
+
   end
 
   def self.find( which )
-    response = YastService.Call("YaPI::NETWORK::Read")
-    ifaces_h = response["interfaces"]
-    if which == :all
-      ret = Hash.new
-      ifaces_h.each do |id, ifaces_h|
-        ret[id] = Interface.new(ifaces_h, id)
+    YastCache.fetch(self, which) {
+      response = YastService.Call("YaPI::NETWORK::Read")
+      ifaces_h = response["interfaces"]
+      if which == :all
+        ret = Hash.new
+        ifaces_h.each do |id, ifaces_h|
+          ret[id] = Interface.new(ifaces_h, id)
+        end
+      else
+        ret = Interface.new(ifaces_h[which], which)
       end
-    else
-      ret = Interface.new(ifaces_h[which], which)
-    end
-    return ret
+      ret
+    }
   end
 
-
   # Saves data from model to system via YaPI. Saves only setted data,
   # so it support partial safe (e.g. save only new timezone if rest of fields 
is not set).
   def update
@@ -74,6 +78,7 @@
     vsettings = [ "a{sa{ss}}", settings ] # bnc#538050
     YastService.Call("YaPI::NETWORK::Write",{"interface" => vsettings})
     # TODO success or not?
+    YastCache.reset(self,@id)
   end
 
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/app/models/route.rb new/www/app/models/route.rb
--- old/www/app/models/route.rb 2011-02-01 10:49:11.000000000 +0100
+++ new/www/app/models/route.rb 2011-05-02 10:22:45.000000000 +0200
@@ -22,6 +22,7 @@
 # Provides set and gets resources from YaPI network module.
 # Main goal is handle YaPI specific calls and data formats. Provides cleaned
 # and well defined data.
+
 class Route < BaseModel::Base
 
   # default gateway
@@ -44,17 +45,20 @@
   #
   # +warn+: YaPI implements default only.
   def self.find( which )
-    response = YastService.Call("YaPI::NETWORK::Read")
-    routes_h = response["routes"]
-    if which == :all
-      ret = Hash.new
-      routes_h.each do |id, route_h|
-        ret[id] = Route.new(route_h, id)
+    which = "default" if which == :all
+    YastCache.fetch(self,which) {
+      response = YastService.Call("YaPI::NETWORK::Read")
+      routes_h = response["routes"]
+      if which == :all
+        ret = Hash.new
+        routes_h.each do |id, route_h|
+          ret[id] = Route.new(route_h, id)
+        end
+      else
+        ret = Route.new(routes_h[which], which)
       end
-    else
-      ret = Route.new(routes_h[which], which)
-    end
-    return ret
+      ret
+    }
   end
 
   # Saves data from model to system via YaPI. Saves only setted data,
@@ -66,6 +70,7 @@
     }
     vsettings = [ "a{sa{ss}}", settings ] # bnc#538050
     ret = YastService.Call("YaPI::NETWORK::Write",{"route" => vsettings})
+    YastCache.reset(self,@id)
     raise RouteError.new(ret["error"]) if ret["exit"] != "0"
   end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/test/functional/dns_controller_test.rb 
new/www/test/functional/dns_controller_test.rb
--- old/www/test/functional/dns_controller_test.rb      2010-08-27 
14:58:55.000000000 +0200
+++ new/www/test/functional/dns_controller_test.rb      2011-04-11 
12:49:05.000000000 +0200
@@ -24,14 +24,14 @@
 class DnsControllerTest < ActionController::TestCase
 
   def setup
-    @model_class = DNS
-    # FIXME: bad mock for DNS (field name mismatch):
-    # DNS.stubs(:find).returns(DNS.new({"BAD" => ["d1", "d2"], "KEYS"=> ["s1", 
"s2"]}))
+    @model_class = Dns
+    # FIXME: bad mock for Dns (field name mismatch):
+    # Dns.stubs(:find).returns(Dns.new({"BAD" => ["d1", "d2"], "KEYS"=> ["s1", 
"s2"]}))
 
     # in test_access_show_xml:
     # add assert_response :success)
     # in case of error: give a nicer error than 500
-    DNS.stubs(:find).returns(DNS.new({"searches" => ["d1", "d2"], 
"nameservers" => ["s1", "s2"]}))
+    Dns.stubs(:find).returns(Dns.new({"searches" => ["d1", "d2"], 
"nameservers" => ["s1", "s2"]}))
     @controller = Network::DnsController.new
     @request = ActionController::TestRequest.new
     # http://railsforum.com/viewtopic.php?id=1719
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/test/unit/dns_test.rb 
new/www/test/unit/dns_test.rb
--- old/www/test/unit/dns_test.rb       2010-08-27 14:58:55.000000000 +0200
+++ new/www/test/unit/dns_test.rb       2011-04-11 12:49:05.000000000 +0200
@@ -21,7 +21,7 @@
 
 require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
 
-class DNSTest < ActiveSupport::TestCase
+class DnsTest < ActiveSupport::TestCase
 
    RESPONSE_FULL = {
                   'interfaces'=>{
@@ -37,13 +37,13 @@
  end
 
  def test_index
-   dns = DNS.find
+   dns = Dns.find
    assert_instance_of Array, dns.searches
    assert_instance_of Array, dns.nameservers
  end
 
  def test_validations
-   dns = DNS.find
+   dns = Dns.find
    assert dns.valid?
    dns.nameservers = ["<danger script>"]
    assert dns.invalid?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/www/test/unit/route_test.rb 
new/www/test/unit/route_test.rb
--- old/www/test/unit/route_test.rb     2010-08-27 14:58:55.000000000 +0200
+++ new/www/test/unit/route_test.rb     2011-04-11 12:49:05.000000000 +0200
@@ -44,9 +44,8 @@
  
  def test_index
    routes = Route.find(:all)
-   assert_instance_of Hash, routes
-   route = routes["default"]
-   assert_equal 'default', route.id
+   assert_instance_of Route, routes
+   assert_equal 'default', routes.id
  end
 
  def test_validations


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



Remember to have fun...

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to