A bit weird to me, but since it was already broken, +1

On Mar 18, 2010, at 12:10 PM, Jesse Wolfe wrote:

The XMLRPC interface for RAL resources was broken, and has been
completely replaced by the REST interface.

Signed-off-by: Jesse Wolfe <[email protected]>
---
lib/puppet/network/handler/resource.rb | 190 --------------------------------
spec/integration/network/client.rb     |    2 +-
spec/integration/network/handler.rb    |    2 +-
3 files changed, 2 insertions(+), 192 deletions(-)
delete mode 100755 lib/puppet/network/handler/resource.rb

diff --git a/lib/puppet/network/handler/resource.rb b/lib/puppet/ network/handler/resource.rb
deleted file mode 100755
index 6f8d3df..0000000
--- a/lib/puppet/network/handler/resource.rb
+++ /dev/null
@@ -1,190 +0,0 @@
-require 'puppet'
-require 'puppet/network/handler'
-
-# Serve Puppet elements. Useful for querying, copying, and, um, other stuff.
-class Puppet::Network::Handler
-    class Resource < Handler
- desc "An interface for interacting with client-based resources that can - be used for querying or managing remote machines without using Puppet's
-        central server tools.
-
- The ``describe`` and ``list`` methods return TransBuckets containing - TransObject instances (``describe`` returns a single TransBucket), - and the ``apply`` method accepts a TransBucket of TransObjects and
-        applies them locally.
-        "
-
-        attr_accessor :local
-
- @interface = XMLRPC::Service::Interface.new("resource") { | iface|
-            iface.add_method("string apply(string, string)")
- iface.add_method("string describe(string, string, array, array)")
-            iface.add_method("string list(string, array, string)")
-        }
-
-        side :client
-
-        # Apply a TransBucket as a transaction.
- def apply(bucket, format = "yaml", client = nil, clientip = nil)
-            unless local?
-                begin
-                    case format
-                    when "yaml"
-                        bucket = YAML::load(Base64.decode64(bucket))
-                    else
- raise Puppet::Error, "Unsupported format '%s'" % format
-                    end
-                rescue => detail
- raise Puppet::Error, "Could not load YAML TransBucket: %s" % detail
-                end
-            end
-
-            catalog = bucket.to_catalog
-
-            # And then apply the catalog.  This way we're reusing all
- # the code in there. It should probably just be separated out, though.
-            transaction = catalog.apply
-
-            # And then clean up
-            catalog.clear(true)
-
- # It'd be nice to return some kind of report, but... at this point
-            # we have no such facility.
-            return "success"
-        end
-
- # Describe a given object. This returns the 'is' values for every property
-        # available on the object type.
- def describe(type, name, retrieve = nil, ignore = [], format = "yaml", client = nil, clientip = nil) - Puppet.info "Describing %s[%s]" % [type.to_s.capitalize, name]
-            @local = true unless client
-            typeklass = nil
-            unless typeklass = Puppet::Type.type(type)
- raise Puppet::Error, "Puppet type %s is unsupported" % type
-            end
-
-            obj = nil
-
-            retrieve ||= :all
-            ignore ||= []
-
-            begin
- obj = typeklass.create(:name => name, :check => retrieve)
-            rescue Puppet::Error => detail
- raise Puppet::Error, "%s[%s] could not be created: %s" %
-                    [type, name, detail]
-            end
-
-            unless obj
-                raise XMLRPC::FaultException.new(
-                    1, "Could not create %s[%s]" % [type, name]
-                )
-            end
-
-            trans = obj.to_trans
-
- # Now get rid of any attributes they specifically don't want
-            ignore.each do |st|
-                if trans.include? st
-                    trans.delete(st)
-                end
-            end
-
-            # And get rid of any attributes that are nil
-            trans.each do |attr, value|
-                if value.nil?
-                    trans.delete(attr)
-                end
-            end
-
-            unless @local
-                case format
-                when "yaml"
-                    trans = Base64.encode64(YAML::dump(trans))
-                else
-                    raise XMLRPC::FaultException.new(
-                        1, "Unavailable config format %s" % format
-                    )
-                end
-            end
-
-            return trans
-        end
-
-        # Create a new fileserving module.
-        def initialize(hash = {})
-            if hash[:Local]
-                @local = hash[:Local]
-            else
-                @local = false
-            end
-        end
-
-        # List all of the elements of a given type.
- def list(type, ignore = [], base = nil, format = "yaml", client = nil, clientip = nil)
-            @local = true unless client
-            typeklass = nil
-            unless typeklass = Puppet::Type.type(type)
- raise Puppet::Error, "Puppet type %s is unsupported" % type
-            end
-
-            # They can pass in false
-            ignore ||= []
-            ignore = [ignore] unless ignore.is_a? Array
-            bucket = Puppet::TransBucket.new
-            bucket.type = typeklass.name
-
-            typeklass.instances.each do |obj|
-                next if ignore.include? obj.name
-
- #object = Puppet::TransObject.new(obj.name, typeklass.name)
-                bucket << obj.to_trans
-            end
-
-            unless @local
-                case format
-                when "yaml"
-                    begin
-                    bucket = Base64.encode64(YAML::dump(bucket))
-                    rescue => detail
-                        Puppet.err detail
-                        raise XMLRPC::FaultException.new(
-                            1, detail.to_s
-                        )
-                    end
-                else
-                    raise XMLRPC::FaultException.new(
-                        1, "Unavailable config format %s" % format
-                    )
-                end
-            end
-
-            return bucket
-        end
-
-        private
-
-        def authcheck(file, mount, client, clientip)
-            unless mount.allowed?(client, clientip)
-                mount.warning "%s cannot access %s" %
-                    [client, file]
- raise Puppet::AuthorizationError, "Cannot access %s" % mount
-            end
-        end
-
-        # Deal with ignore parameters.
-        def handleignore(children, path, ignore)
-            ignore.each { |ignore|
- Dir.glob(File.join(path,ignore), File::FNM_DOTMATCH) { |match|
-                    children.delete(File.basename(match))
-                }
-            }
-            return children
-        end
-
-        def to_s
-            "resource"
-        end
-    end
-end
-
diff --git a/spec/integration/network/client.rb b/spec/integration/ network/client.rb
index fe1524e..06d145a 100755
--- a/spec/integration/network/client.rb
+++ b/spec/integration/network/client.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/network/client'

describe Puppet::Network::Client do
-    %w{ca file report resource runner status}.each do |name|
+    %w{ca file report runner status}.each do |name|
        it "should have a #{name} client" do
Puppet::Network::Client.client(name).should be_instance_of(Class)
        end
diff --git a/spec/integration/network/handler.rb b/spec/integration/ network/handler.rb
index 44152da..1c2e605 100755
--- a/spec/integration/network/handler.rb
+++ b/spec/integration/network/handler.rb
@@ -5,7 +5,7 @@ require File.dirname(__FILE__) + '/../../spec_helper'
require 'puppet/network/client'

describe Puppet::Network::Handler do
- %w{ca filebucket fileserver master report resource runner status}.each do |name| + %w{ca filebucket fileserver master report runner status}.each do |name|
        it "should have a #{name} client" do
Puppet::Network::Handler.handler(name).should be_instance_of(Class)
        end
--
1.6.3.3

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected] . For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en .



--
You will notice that BeOS has taken the best parts from all the major
operating systems and made them its own. We've got the power of the
Unix command line, the ease of use of the Macintosh interface, and
Minesweeper from Windows. -- Tyler Riti
---------------------------------------------------------------------
Luke Kanies  -|-   http://reductivelabs.com   -|-   +1(615)594-8199

--
You received this message because you are subscribed to the Google Groups "Puppet 
Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to