Sha256: 02fb7e419de3af49e57920290e6146dc3ce6a57d6c9149df75f55e398f6aadd4

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

# unlike the other client classes (again, this design sucks) this class
# is basically just a proxy class -- it calls its methods on the driver
# and that's about it
class Puppet::Client::ProxyClient < Puppet::Client
    def self.mkmethods
        interface = @handler.interface
        namespace = interface.prefix

        interface.methods.each { |ary|
            method = ary[0]
            Puppet.debug "%s: defining %s.%s" % [self, namespace, method]
            self.send(:define_method,method) { |*args|
                begin
                    @driver.send(method, *args)
                rescue XMLRPC::FaultException => detail
                    #Puppet.err "Could not call %s.%s: %s" %
                    #    [namespace, method, detail.faultString]
                    #raise NetworkClientError,
                    #    "XMLRPC Error: %s" % detail.faultString
                    raise NetworkClientError, detail.faultString
                end
            }
        }
    end
end

# $Id: proxy.rb 848 2006-01-24 06:01:58Z luke $

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-0.13.2 lib/puppet/client/proxy.rb
puppet-0.13.1 lib/puppet/client/proxy.rb
puppet-0.13.0 lib/puppet/client/proxy.rb
puppet-0.13.6 lib/puppet/client/proxy.rb
puppet-0.16.0 lib/puppet/client/proxy.rb