# File lib/openshift-origin-msg-broker-mcollective/lib/openshift/mcollective_application_container_proxy.rb, line 1022
      def self.rpc_exec(agent, server=nil, forceRediscovery=false, options=rpc_options)
      
        # Setup the rpc client
        rpc_client = rpcclient(agent, :options => options)

        # Filter to the specified server
        if server
          Rails.logger.debug("DEBUG: rpc_exec: Filtering rpc_exec to server #{server}")
          rpc_client.identity_filter(server)
        end

        if forceRediscovery
          rpc_client.reset
        end
        Rails.logger.debug("DEBUG: rpc_exec: rpc_client=#{rpc_client}")
      
        # Execute a block and make sure we disconnect the client
        begin
          result = yield rpc_client
        ensure
          rpc_client.disconnect
        end

        raise OpenShift::NodeException.new("Node execution failure (error getting result from node).  If the problem persists please contact Red Hat support.", 143) unless result

        result
      end