mcollective-client 2.8.6 → 2.8.7

Sign up to get free protection for your applications and to get access to all the features.
data/lib/mcollective.rb CHANGED
@@ -59,7 +59,7 @@ module MCollective
59
59
 
60
60
  MCollective::Vendor.load_vendored
61
61
 
62
- VERSION="2.8.6"
62
+ VERSION="2.8.7"
63
63
 
64
64
  def self.version
65
65
  VERSION
@@ -15,7 +15,7 @@ module MCollective
15
15
  :timeout => @timeout,
16
16
  :name => "Discovery Agent",
17
17
  :version => MCollective.version,
18
- :url => "http://www.marionette-collective.org",
18
+ :url => "https://docs.puppetlabs.com/mcollective/",
19
19
  :description => "MCollective Discovery Agent"}
20
20
  end
21
21
 
@@ -3,7 +3,7 @@ metadata :name => "rpcutil",
3
3
  :author => "R.I.Pienaar <rip@devco.net>",
4
4
  :license => "Apache License, Version 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 10
8
8
 
9
9
  action "collective_info", :description => "Info about the main and sub collectives" do
@@ -3,7 +3,7 @@ metadata :name => "average",
3
3
  :author => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
6
+ :url => "https://docs.puppetlabs.com/mcollective/plugin_directory/",
7
7
  :timeout => 5
8
8
 
9
9
  usage <<-USAGE
@@ -3,7 +3,7 @@ metadata :name => "Sum",
3
3
  :author => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
6
+ :url => "https://docs.puppetlabs.com/mcollective/plugin_directory/",
7
7
  :timeout => 5
8
8
 
9
9
  usage <<-USAGE
@@ -3,7 +3,7 @@ metadata :name => "summary",
3
3
  :author => "Pieter Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
6
+ :url => "https://docs.puppetlabs.com/mcollective/plugin_directory/",
7
7
  :timeout => 5
8
8
 
9
9
  usage <<-USAGE
@@ -3,7 +3,7 @@ metadata :name => "ActiveMQ Connector",
3
3
  :author => "Puppet Labs",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0.0",
6
- :url => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
6
+ :url => "https://docs.puppetlabs.com/mcollective/plugin_directory/",
7
7
  :timeout => 60
8
8
 
9
9
  requires :mcollective => "2.6.0"
@@ -3,7 +3,7 @@ metadata :name => "RabbitMQ Connector",
3
3
  :author => "Puppet Labs",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0.0",
6
- :url => "http://projects.puppetlabs.com/projects/mcollective-plugins/wiki",
6
+ :url => "https://docs.puppetlabs.com/mcollective/plugin_directory/",
7
7
  :timeout => 60
8
8
 
9
9
  requires :mcollective => "2.6.0"
@@ -3,7 +3,7 @@ metadata :name => "Agent",
3
3
  :author => "R.I.Pienaar <rip@devco.net>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
8
8
 
9
9
  dataquery :description => "Agent Meta Data" do
@@ -3,7 +3,7 @@ metadata :name => "Collective",
3
3
  :author => "Puppet Labs",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
8
8
 
9
9
  dataquery :description => "Collective" do
@@ -3,7 +3,7 @@ metadata :name => "Fact",
3
3
  :author => "Puppet Labs",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
8
8
 
9
9
  dataquery :description => "Fact" do
@@ -3,7 +3,7 @@ metadata :name => "File Stat",
3
3
  :author => "R.I.Pienaar <rip@devco.net>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
8
8
 
9
9
  dataquery :description => "File stat information" do
@@ -9,7 +9,7 @@ module MCollective
9
9
  # :author => "R.I.Pienaar <rip@devco.net>",
10
10
  # :license => "Apache License, Version 2.0",
11
11
  # :version => "1.0",
12
- # :url => "http://marionette-collective.org/",
12
+ # :url => "https://docs.puppetlabs.com/mcollective/",
13
13
  # :timeout => 10
14
14
  #
15
15
  # action "get_fact", :description => "Retrieve a single fact from the fact store" do
@@ -10,7 +10,7 @@ module MCollective
10
10
  # :author => "R.I.Pienaar <rip@devco.net>",
11
11
  # :license => "ASL 2.0",
12
12
  # :version => "1.0",
13
- # :url => "http://marionette-collective.org/",
13
+ # :url => "https://docs.puppetlabs.com/mcollective/",
14
14
  # :timeout => 1
15
15
  #
16
16
  # dataquery :description => "Agent Meta Data" do
@@ -7,7 +7,7 @@ module MCollective
7
7
  # :author => "R.I.Pienaar <rip@devco.net>",
8
8
  # :license => "ASL 2.0",
9
9
  # :version => "0.1",
10
- # :url => "http://marionette-collective.org/",
10
+ # :url => "https://docs.puppetlabs.com/mcollective/",
11
11
  # :timeout => 2
12
12
  #
13
13
  # discovery do
@@ -3,7 +3,7 @@ metadata :name => "flatfile",
3
3
  :author => "R.I.Pienaar <rip@devco.net>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "0.1",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 0
8
8
 
9
9
  discovery do
@@ -3,7 +3,7 @@ metadata :name => "mc",
3
3
  :author => "R.I.Pienaar <rip@devco.net>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "0.1",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 2
8
8
 
9
9
  discovery do
@@ -3,7 +3,7 @@ metadata :name => "stdin",
3
3
  :author => "Tomas Doran <bobtfish@bobtfish.net.net>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "0.1",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 0
8
8
 
9
9
  discovery do
@@ -134,14 +134,20 @@ module MCollective
134
134
  # includes a function
135
135
  def self.eval_compound_fstatement(function_hash)
136
136
  l_compare = execute_function(function_hash)
137
+ r_compare = function_hash["r_compare"]
138
+ operator = function_hash["operator"]
137
139
 
138
140
  # Break out early and return false if the function returns nil
139
- return false unless l_compare
141
+ if l_compare.nil?
142
+ return false
143
+ end
140
144
 
141
145
  # Prevent unwanted discovery by limiting comparison operators
142
146
  # on Strings and Booleans
143
- if((l_compare.is_a?(String) || l_compare.is_a?(TrueClass) || l_compare.is_a?(FalseClass)) && function_hash["operator"].match(/<|>/))
144
- Log.debug "Cannot do > and < comparison on Booleans and Strings '#{l_compare} #{function_hash["operator"]} #{function_hash["r_compare"]}'"
147
+ if((l_compare.is_a?(String) || l_compare.is_a?(TrueClass) ||
148
+ l_compare.is_a?(FalseClass)) && function_hash["operator"].match(/<|>/))
149
+ Log.debug("Cannot do > and < comparison on Booleans and Strings " +
150
+ "'#{l_compare} #{function_hash["operator"]} #{function_hash["r_compare"]}'")
145
151
  return false
146
152
  end
147
153
 
@@ -152,28 +158,30 @@ module MCollective
152
158
  end
153
159
 
154
160
  # Escape strings for evaluation
155
- function_hash["r_compare"] = "\"#{function_hash["r_compare"]}\"" if(l_compare.is_a?(String) && !(function_hash["operator"] =~ /=~|!=~/))
161
+ if (l_compare.is_a?(String) && !(function_hash["operator"] =~ /=~|!=~/))
162
+ r_compare = "\"#{r_compare}\""
163
+ end
156
164
 
157
165
  # Do a regex comparison if right compare string is a regex
158
- if function_hash["operator"] =~ /(=~|!=~)/
166
+ if operator=~ /(=~|!=~)/
159
167
  # Fail if left compare value isn't a string
160
168
  unless l_compare.is_a?(String)
161
169
  Log.debug("Cannot do a regex check on a non string value.")
162
170
  return false
163
171
  else
164
- compare_result = l_compare.match(function_hash["r_compare"])
172
+ result = l_compare.match(r_compare)
165
173
  # Flip return value for != operator
166
174
  if function_hash["operator"] == "!=~"
167
- !((compare_result.nil?) ? false : true)
175
+ return !result
168
176
  else
169
- (compare_result.nil?) ? false : true
177
+ return !!result
170
178
  end
171
179
  end
172
180
  # Otherwise evaluate the logical comparison
173
181
  else
174
182
  l_compare = "\"#{l_compare}\"" if l_compare.is_a?(String)
175
- result = eval("#{l_compare} #{function_hash["operator"]} #{function_hash["r_compare"]}")
176
- (result.nil?) ? false : result
183
+ result = eval("#{l_compare} #{operator} #{r_compare}")
184
+ return result
177
185
  end
178
186
  end
179
187
 
@@ -4,7 +4,7 @@ module MCollective
4
4
  # you would do for each agent allowing you to just create methods following a naming
5
5
  # standard leaving the heavy lifting up to this clas.
6
6
  #
7
- # See http://marionette-collective.org/simplerpc/agents.html
7
+ # See https://docs.puppetlabs.com/mcollective/simplerpc/agents.html
8
8
  #
9
9
  # It only really makes sense to use this with a Simple RPC client on the other end, basic
10
10
  # usage would be:
@@ -3,5 +3,5 @@ metadata :name => "Array",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "IPv4 Address",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "IPv6 Address",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "Length",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "Regex",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "Shellsafe",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -3,5 +3,5 @@ metadata :name => "Typecheck",
3
3
  :author => "P. Loubser <pieter.loubser@puppetlabs.com>",
4
4
  :license => "ASL 2.0",
5
5
  :version => "1.0",
6
- :url => "http://marionette-collective.org/",
6
+ :url => "https://docs.puppetlabs.com/mcollective/",
7
7
  :timeout => 1
@@ -230,6 +230,14 @@ module MCollective
230
230
  result.should == true
231
231
  end
232
232
 
233
+ it "should return false if right value is a regex and matches the left value and !=~ is the operator" do
234
+ Matcher.expects(:execute_function).returns("teststring")
235
+ @function_hash["r_compare"] = /teststring/
236
+ @function_hash["operator"] = "!=~"
237
+ result = Matcher.eval_compound_fstatement(@function_hash)
238
+ result.should == false
239
+ end
240
+
233
241
  it "should return false if right value is a regex, operator is != and regex equals left value" do
234
242
  Matcher.expects(:execute_function).returns("teststring")
235
243
  @function_hash["r_compare"] = /teststring/
@@ -254,6 +262,14 @@ module MCollective
254
262
  result.should == true
255
263
  end
256
264
 
265
+ it "should return true if we do a false=false comparison" do
266
+ Matcher.expects(:execute_function).returns(false)
267
+ @function_hash["r_compare"] = false
268
+ @function_hash["operator"] = "=="
269
+ result = Matcher.eval_compound_fstatement(@function_hash)
270
+ result.should == true
271
+ end
272
+
257
273
  it "should return false if left value does not logically compare to right value" do
258
274
  Matcher.expects(:execute_function).returns("1")
259
275
  @function_hash["r_compare"] = "1"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcollective-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.6
4
+ version: 2.8.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-15 00:00:00.000000000 Z
12
+ date: 2017-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: systemu