X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=doc%2FMCollective%2FData%2FBase.html;fp=doc%2FMCollective%2FData%2FBase.html;h=a7d86bb48c2be650c568fbac6a2f176b4240045d;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=0000000000000000000000000000000000000000;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/MCollective/Data/Base.html b/doc/MCollective/Data/Base.html new file mode 100644 index 0000000..a7d86bb --- /dev/null +++ b/doc/MCollective/Data/Base.html @@ -0,0 +1,741 @@ + + + + + + + Class: MCollective::Data::Base + + + + + + + + + + + +
+
+
+

In Files

+ +
+ + +
+ +
+ + + +
+

Parent

+ + + +
+ + + + + + + +
+

Methods

+ +
+ + + + +
+ +
+ + + + + +
+

Class Index + [+]

+
+
+ Quicksearch + +
+
+ + + +
+ + +
+
+ +
+

MCollective::Data::Base

+ +
+ +
+ + + + + + +
+

Attributes

+ + +
+ + +
+ name[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ result[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ ddl[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + +
+ timeout[R] +
+ +
+ +

(Not documented)

+ +
+
+ +
+ + + + +
+

Public Class Methods

+ + +
+ + +
+ + activate?() + click to toggle source + +
+ +
+ +

+Always be active unless a specific block is given with activate_when +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 60
+60:       def self.activate?
+61:         return true
+62:       end
+
+ +
+ + +
+ + +
+ + +
+ + activate_when(&block) + click to toggle source + +
+ +
+ +

+activate_when do +

+
+   file.exist?("/usr/bin/puppet")
+
+

+end +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 53
+53:       def self.activate_when(&block)
+54:         (class << self; self; end).instance_eval do
+55:           define_method("activate?", &block)
+56:         end
+57:       end
+
+ +
+ + +
+ + +
+ + +
+ + inherited(klass) + click to toggle source + +
+ +
+ +

+Register plugins that inherits base +

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 7
+ 7:       def self.inherited(klass)
+ 8:         type = klass.to_s.split("::").last.downcase
+ 9: 
+10:         PluginManager << {:type => type, :class => klass.to_s, :single_instance => false}
+11:       end
+
+ +
+ + +
+ + +
+ + +
+ + new() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 13
+13:       def initialize
+14:         @name = self.class.to_s.split("::").last.downcase
+15:         @ddl = DDL.new(@name, :data)
+16:         @result = Result.new(@ddl.dataquery_interface[:output])
+17:         @timeout = @ddl.meta[:timeout] || 1
+18: 
+19:         startup_hook
+20:       end
+
+ +
+ + +
+ + +
+ + +
+ + query(&block) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 42
+42:       def self.query(&block)
+43:         self.module_eval { define_method("query_data", &block) }
+44:       end
+
+ +
+ + +
+ + +
+ +
+

Public Instance Methods

+ + +
+ + +
+ + ddl_validate(what) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 46
+46:       def ddl_validate(what)
+47:         Data.ddl_validate(@ddl, what)
+48:       end
+
+ +
+ + +
+ + +
+ + +
+ + lookup(what) + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 22
+22:       def lookup(what)
+23:         ddl_validate(what)
+24: 
+25:         Log.debug("Doing data query %s for '%s'" % [ @name, what ])
+26: 
+27:         Timeout::timeout(@timeout) do
+28:           query_data(what)
+29:         end
+30: 
+31:         @result
+32:       rescue Timeout::Error
+33:         # Timeout::Error is a inherited from Interrupt which seems a really
+34:         # strange choice, making it an equivelant of ^C and such.  Catch it
+35:         # and raise something less critical that will not the runner to just
+36:         # give up the ghost
+37:         msg = "Data plugin %s timed out on query '%s'" % [@name, what]
+38:         Log.error(msg)
+39:         raise MsgTTLExpired, msg
+40:       end
+
+ +
+ + +
+ + +
+ + +
+ + startup_hook() + click to toggle source + +
+ +
+ +

(Not documented)

+ + + +
+
+    # File lib/mcollective/data/base.rb, line 64
+64:       def startup_hook;end
+
+ +
+ + +
+ + +
+ + +
+ + +
+ +

Disabled; run with --debug to generate this.

+ +
+ +
+

[Validate]

+

Generated with the Darkfish + Rdoc Generator 1.1.6.

+
+ + + +