Update version according to OSCI-856
[packages/precise/mcollective.git] / doc / classes / MCollective / RPC / Agent.html
diff --git a/doc/classes/MCollective/RPC/Agent.html b/doc/classes/MCollective/RPC/Agent.html
new file mode 100644 (file)
index 0000000..4050b22
--- /dev/null
@@ -0,0 +1,462 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html 
+     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <title>Class: MCollective::RPC::Agent</title>
+  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
+  <script type="text/javascript">
+  // <![CDATA[
+
+  function popupCode( url ) {
+    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
+  }
+
+  function toggleCode( id ) {
+    if ( document.getElementById )
+      elem = document.getElementById( id );
+    else if ( document.all )
+      elem = eval( "document.all." + id );
+    else
+      return false;
+
+    elemStyle = elem.style;
+    
+    if ( elemStyle.display != "block" ) {
+      elemStyle.display = "block"
+    } else {
+      elemStyle.display = "none"
+    }
+
+    return true;
+  }
+  
+  // Make codeblocks hidden by default
+  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
+  
+  // ]]>
+  </script>
+
+</head>
+<body>
+
+
+
+    <div id="classHeader">
+        <table class="header-table">
+        <tr class="top-aligned-row">
+          <td><strong>Class</strong></td>
+          <td class="class-name-in-header">MCollective::RPC::Agent</td>
+        </tr>
+        <tr class="top-aligned-row">
+            <td><strong>In:</strong></td>
+            <td>
+                <a href="../../../files/lib/mcollective/rpc/agent_rb.html">
+                lib/mcollective/rpc/agent.rb
+                </a>
+        <br />
+            </td>
+        </tr>
+
+        <tr class="top-aligned-row">
+            <td><strong>Parent:</strong></td>
+            <td>
+                Object
+            </td>
+        </tr>
+        </table>
+    </div>
+  <!-- banner header -->
+
+  <div id="bodyContent">
+
+
+
+  <div id="contextContent">
+
+    <div id="description">
+      <p>
+A wrapper around the traditional agent, it takes care of a lot of the
+tedious setup you would do for each agent allowing you to just create
+methods following a naming standard leaving the heavy lifting up to this
+clas.
+</p>
+<p>
+See <a
+href="http://marionette-collective.org/simplerpc/agents.html">marionette-collective.org/simplerpc/agents.html</a>
+</p>
+<p>
+It only really makes sense to use this with a Simple <a
+href="../RPC.html">RPC</a> client on the other end, basic usage would be:
+</p>
+<pre>
+   module MCollective
+     module Agent
+       class Helloworld&lt;RPC::Agent
+         action &quot;hello&quot; do
+           reply[:msg] = &quot;Hello #{request[:name]}&quot;
+         end
+
+         action &quot;foo&quot; do
+           implemented_by &quot;/some/script.sh&quot;
+         end
+       end
+     end
+   end
+</pre>
+<p>
+If you wish to implement the logic for an action using an external script
+use the implemented_by method that will cause your script to be run with 2
+arguments.
+</p>
+<p>
+The first argument is a file containing JSON with the request and the 2nd
+argument is where the script should save its output as a JSON hash.
+</p>
+<p>
+We also currently have the validation code in here, this will be moved to
+plugins soon.
+</p>
+
+    </div>
+
+
+   </div>
+
+    <div id="method-list">
+      <h3 class="section-bar">Methods</h3>
+
+      <div class="name-list">
+      <a href="#M000084">actions</a>&nbsp;&nbsp;
+      <a href="#M000083">activate?</a>&nbsp;&nbsp;
+      <a href="#M000082">handlemsg</a>&nbsp;&nbsp;
+      <a href="#M000081">load_ddl</a>&nbsp;&nbsp;
+      <a href="#M000080">new</a>&nbsp;&nbsp;
+      </div>
+    </div>
+
+  </div>
+
+
+    <!-- if includes -->
+    <div id="includes">
+      <h3 class="section-bar">Included Modules</h3>
+
+      <div id="includes-list">
+        <span class="include-name"><a href="../Translatable.html">Translatable</a></span>
+      </div>
+    </div>
+
+    <div id="section">
+
+
+
+
+
+    <div id="attribute-list">
+      <h3 class="section-bar">Attributes</h3>
+
+      <div class="name-list">
+        <table>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">agent_name</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">config</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">ddl</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">logger</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">meta</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">reply</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">request</td>
+          <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        <tr class="top-aligned-row context-row">
+          <td class="context-item-name">timeout</td>
+          <td class="context-item-value">&nbsp;[R]&nbsp;</td>
+          <td class="context-item-desc"></td>
+        </tr>
+        </table>
+      </div>
+    </div>
+      
+
+
+    <!-- if method_list -->
+    <div id="methods">
+      <h3 class="section-bar">Public Class methods</h3>
+
+      <div id="method-M000084" class="method-detail">
+        <a name="M000084"></a>
+
+        <div class="method-heading">
+          <a href="#M000084" class="method-signature">
+          <span class="method-name">actions</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+Returns an array of <a href="Agent.html#M000084">actions</a> this agent
+support
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000084-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 157</span>
+157:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">actions</span>
+158:         <span class="ruby-identifier">public_instance_methods</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">grep</span>(<span class="ruby-regexp re">/_action$/</span>).<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">method</span><span class="ruby-operator">|</span>
+159:           <span class="ruby-identifier">$1</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">method</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/(.+)_action$/</span>
+160:         <span class="ruby-keyword kw">end</span>
+161:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000083" class="method-detail">
+        <a name="M000083"></a>
+
+        <div class="method-heading">
+          <a href="#M000083" class="method-signature">
+          <span class="method-name">activate?</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p>
+By default <a href="../RPC.html">RPC</a> <a
+href="../Agents.html">Agents</a> support a toggle in the configuration that
+can enable and disable them based on the agent name
+</p>
+<p>
+Example an agent called Foo can have:
+</p>
+<p>
+plugin.foo.activate_agent = false
+</p>
+<p>
+and this will prevent the agent from loading on this particular machine.
+</p>
+<p>
+<a href="../Agents.html">Agents</a> can use the activate_when helper to
+override this for example:
+</p>
+<p>
+activate_when do
+</p>
+<pre>
+   File.exist?(&quot;/usr/bin/puppet&quot;)
+</pre>
+<p>
+end
+</p>
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000083-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 142</span>
+142:       <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">activate?</span>
+143:         <span class="ruby-identifier">agent_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+144: 
+145:         <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC37</span>, <span class="ruby-value str">&quot;Starting default activation checks for the '%{agent}' agent&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent_name</span>)
+146: 
+147:         <span class="ruby-identifier">should_activate</span> = <span class="ruby-constant">Util</span>.<span class="ruby-identifier">str_to_bool</span>(<span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>.<span class="ruby-identifier">pluginconf</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-node">&quot;#{agent_name}.activate_agent&quot;</span>, <span class="ruby-keyword kw">true</span>))
+148: 
+149:         <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">should_activate</span>
+150:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC38</span>, <span class="ruby-value str">&quot;Found plugin configuration '%{agent}.activate_agent' with value '%{should_activate}'&quot;</span>, <span class="ruby-identifier">:debug</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">agent_name</span>, <span class="ruby-identifier">:should_activate</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">should_activate</span>)
+151:         <span class="ruby-keyword kw">end</span>
+152: 
+153:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">should_activate</span>
+154:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000080" class="method-detail">
+        <a name="M000080"></a>
+
+        <div class="method-heading">
+          <a href="#M000080" class="method-signature">
+          <span class="method-name">new</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000080-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 40</span>
+40:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
+41:         <span class="ruby-ivar">@agent_name</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-value str">&quot;::&quot;</span>).<span class="ruby-identifier">last</span>.<span class="ruby-identifier">downcase</span>
+42: 
+43:         <span class="ruby-identifier">load_ddl</span>
+44: 
+45:         <span class="ruby-ivar">@logger</span> = <span class="ruby-constant">Log</span>.<span class="ruby-identifier">instance</span>
+46:         <span class="ruby-ivar">@config</span> = <span class="ruby-constant">Config</span>.<span class="ruby-identifier">instance</span>
+47: 
+48:         <span class="ruby-comment cmt"># if we have a global authorization provider enable it</span>
+49:         <span class="ruby-comment cmt"># plugins can still override it per plugin</span>
+50:         <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">authorized_by</span>(<span class="ruby-ivar">@config</span>.<span class="ruby-identifier">rpcauthprovider</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@config</span>.<span class="ruby-identifier">rpcauthorization</span>
+51: 
+52:         <span class="ruby-identifier">startup_hook</span>
+53:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <h3 class="section-bar">Public Instance methods</h3>
+
+      <div id="method-M000082" class="method-detail">
+        <a name="M000082"></a>
+
+        <div class="method-heading">
+          <a href="#M000082" class="method-signature">
+          <span class="method-name">handlemsg</span><span class="method-args">(msg, connection)</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000082-source">
+<pre>
+     <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 64</span>
+ 64:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handlemsg</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">connection</span>)
+ 65:         <span class="ruby-ivar">@request</span> = <span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-ivar">@ddl</span>)
+ 66:         <span class="ruby-ivar">@reply</span> = <span class="ruby-constant">RPC</span><span class="ruby-operator">::</span><span class="ruby-constant">Reply</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-ivar">@ddl</span>)
+ 67: 
+ 68:         <span class="ruby-keyword kw">begin</span>
+ 69:           <span class="ruby-comment cmt"># Incoming requests need to be validated against the DDL thus reusing</span>
+ 70:           <span class="ruby-comment cmt"># all the work users put into creating DDLs and creating a consistent</span>
+ 71:           <span class="ruby-comment cmt"># quality of input validation everywhere with the a simple once off</span>
+ 72:           <span class="ruby-comment cmt"># investment of writing a DDL</span>
+ 73:           <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">validate!</span>
+ 74: 
+ 75:           <span class="ruby-comment cmt"># Calls the authorization plugin if any is defined</span>
+ 76:           <span class="ruby-comment cmt"># if this raises an exception we wil just skip processing this</span>
+ 77:           <span class="ruby-comment cmt"># message</span>
+ 78:           <span class="ruby-identifier">authorization_hook</span>(<span class="ruby-ivar">@request</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-value str">&quot;authorization_hook&quot;</span>)
+ 79: 
+ 80:           <span class="ruby-comment cmt"># Audits the request, currently continues processing the message</span>
+ 81:           <span class="ruby-comment cmt"># we should make this a configurable so that an audit failure means</span>
+ 82:           <span class="ruby-comment cmt"># a message wont be processed by this node depending on config</span>
+ 83:           <span class="ruby-identifier">audit_request</span>(<span class="ruby-ivar">@request</span>, <span class="ruby-identifier">connection</span>)
+ 84: 
+ 85:           <span class="ruby-identifier">before_processing_hook</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">connection</span>)
+ 86: 
+ 87:           <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">respond_to?</span>(<span class="ruby-node">&quot;#{@request.action}_action&quot;</span>)
+ 88:             <span class="ruby-identifier">send</span>(<span class="ruby-node">&quot;#{@request.action}_action&quot;</span>)
+ 89:           <span class="ruby-keyword kw">else</span>
+ 90:             <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC36</span>, <span class="ruby-value str">&quot;Unknown action '%{action}' for agent '%{agent}'&quot;</span>, <span class="ruby-identifier">:warn</span>, <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">agent</span>)
+ 91:             <span class="ruby-identifier">raise</span> <span class="ruby-constant">UnknownRPCAction</span>, <span class="ruby-node">&quot;Unknown action '#{@request.action}' for agent '#{@request.agent}'&quot;</span>
+ 92:           <span class="ruby-keyword kw">end</span>
+ 93:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">RPCAborted</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+ 94:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">1</span>
+ 95: 
+ 96:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">UnknownRPCAction</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+ 97:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">2</span>
+ 98: 
+ 99:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">MissingRPCData</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+100:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">3</span>
+101: 
+102:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidRPCData</span>, <span class="ruby-constant">DDLValidationError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+103:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">4</span>
+104: 
+105:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">UnknownRPCError</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+106:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;%s#%s failed: %s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@agent_name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>])
+107:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n\t&quot;</span>))
+108:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">5</span>
+109: 
+110:         <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+111:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-value str">&quot;%s#%s failed: %s: %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-ivar">@agent_name</span>, <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">action</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>])
+112:           <span class="ruby-constant">Log</span>.<span class="ruby-identifier">error</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n\t&quot;</span>))
+113:           <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">fail</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-value">5</span>
+114: 
+115:         <span class="ruby-keyword kw">end</span>
+116: 
+117:         <span class="ruby-identifier">after_processing_hook</span>
+118: 
+119:         <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@request</span>.<span class="ruby-identifier">should_respond?</span>
+120:           <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@reply</span>.<span class="ruby-identifier">to_hash</span>
+121:         <span class="ruby-keyword kw">else</span>
+122:           <span class="ruby-identifier">log_code</span>(<span class="ruby-identifier">:PLMC35</span>, <span class="ruby-value str">&quot;Client did not request a response, surpressing reply&quot;</span>, <span class="ruby-identifier">:debug</span>)
+123:           <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
+124:         <span class="ruby-keyword kw">end</span>
+125:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+      <div id="method-M000081" class="method-detail">
+        <a name="M000081"></a>
+
+        <div class="method-heading">
+          <a href="#M000081" class="method-signature">
+          <span class="method-name">load_ddl</span><span class="method-args">()</span>
+          </a>
+        </div>
+      
+        <div class="method-description">
+          <p><a class="source-toggle" href="#"
+            onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
+          <div class="method-source-code" id="M000081-source">
+<pre>
+    <span class="ruby-comment cmt"># File lib/mcollective/rpc/agent.rb, line 55</span>
+55:       <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_ddl</span>
+56:         <span class="ruby-ivar">@ddl</span> = <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@agent_name</span>, <span class="ruby-identifier">:agent</span>)
+57:         <span class="ruby-ivar">@meta</span> = <span class="ruby-ivar">@ddl</span>.<span class="ruby-identifier">meta</span>
+58:         <span class="ruby-ivar">@timeout</span> = <span class="ruby-ivar">@meta</span>[<span class="ruby-identifier">:timeout</span>] <span class="ruby-operator">||</span> <span class="ruby-value">10</span>
+59: 
+60:       <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
+61:         <span class="ruby-constant">DDL</span>.<span class="ruby-identifier">validation_fail!</span>(<span class="ruby-identifier">:PLMC24</span>, <span class="ruby-value str">&quot;Failed to load DDL for the '%{agent}' agent, DDLs are required: %{error_class}: %{error}&quot;</span>, <span class="ruby-identifier">:error</span>, <span class="ruby-identifier">:agent</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@agent_name</span>, <span class="ruby-identifier">:error_class</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">class</span>, <span class="ruby-identifier">:error</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">to_s</span>)
+62:       <span class="ruby-keyword kw">end</span>
+</pre>
+          </div>
+        </div>
+      </div>
+
+
+    </div>
+
+
+  </div>
+
+
+<div id="validator-badges">
+  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
+</div>
+
+</body>
+</html>
\ No newline at end of file