Class: Puppet::Network::Client::ProxyClient

Inherits:
Puppet::Network::Client show all
Defined in:
lib/puppet/network/client/proxy.rb

Overview

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

Direct Known Subclasses

File, Runner, Status

Constant Summary

Constants inherited from Puppet::Network::Client

Client

Instance Attribute Summary

Attributes inherited from Puppet::Network::Client

#driver, #lastrun, #local, #schedule, #stopping

Attributes included from Util::SubclassLoader

#classloader, #loader

Attributes included from SSLCertificates::Support

#cacert

Class Method Summary collapse

Methods inherited from Puppet::Network::Client

drivername, handler, #initialize, #local?, #recycle_connection, #run, #runnow, #scheduled?, #shutdown, #start, xmlrpc_client

Methods included from Util::SubclassLoader

#each, #handle_subclasses, #inherited, #method_missing, #name, #subclasses

Methods included from SSLCertificates::Support

keytype, #rename_files_with_uppercase, #requestcert

Methods included from Util::MethodHelper

#requiredopts, #set_options, #symbolize_options

Methods included from Util

activerecord_version, benchmark, chuser, classproxy, #execfail, #execpipe, execute, logmethods, memory, proxy, recmkdir, secure_open, symbolize, symbolizehash, symbolizehash!, synchronize_on, thinmark, #threadlock, which, withumask

Methods included from Util::POSIX

#get_posix_field, #gid, #idfield, #methodbyid, #methodbyname, #search_posix_field, #uid

Constructor Details

This class inherits a constructor from Puppet::Network::Client

Class Method Details

.mkmethodsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/puppet/network/client/proxy.rb', line 5

def self.mkmethods
  interface = self.handler.interface
  namespace = interface.prefix


  interface.methods.each { |ary|
    method = ary[0]
    Puppet.debug "#{self}: defining #{namespace}.#{method}"
    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: #{detail.faultString}"
        raise NetworkClientError, detail.faultString
      end
    }
  }
end