choria-mcorpc-support 2.20.7 → 2.22.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: '069a8ceae281b1be5fc39b924c2b95c3fddb8242'
4
- data.tar.gz: 97d52bf4968e7acc2c3534c74bc84e2ff75c0f27
3
+ metadata.gz: fe21f29a02c82194f42269a70b3bbcf8d93a8cd6
4
+ data.tar.gz: c1ce8445e163f31010ad687d8e26c527fe27ee64
5
5
  SHA512:
6
- metadata.gz: 2d5810c5b35911eba73e85086caa5764efbfb0d9b77aa504bf64ad538a35da7a0f40552d6dc3a6e43e6f41420684f83f27922b1f8d33018b8b439ac0ecaee670
7
- data.tar.gz: a69247825c9d2cc0c598f01ac46832ef02508522ca69a6fc886bed37866ad8652562b683a3f25901c5a8ea6feadf38a3af93d7a948ae018e96050a03c93541a4
6
+ metadata.gz: 0acc8d8acffecf2185a7486cf7772e66bc4c1662541b2f2795cc3ac2f2eee32cc2511787730ce7c2464da21423fe30dddee891c95eefef86082e7747afc953d1
7
+ data.tar.gz: 3c08ae6ce075e9953a68db9c40439ce448cf555a0e0cc6be30f42a806a065efd6e5a4d0b7bf2a957976e2751f63a996157f46d973279caef26dafdfbbd469924
@@ -54,7 +54,7 @@ module MCollective
54
54
  require "mcollective/util"
55
55
  require "mcollective/validator"
56
56
 
57
- VERSION = "2.20.7".freeze
57
+ VERSION = "2.22.1".freeze
58
58
 
59
59
  def self.version
60
60
  VERSION
@@ -12,6 +12,8 @@ class MCollective::Application::Facts<MCollective::Application
12
12
  def show_single_fact_report(fact, facts, verbose=false)
13
13
  puts("Report for fact: #{fact}\n\n")
14
14
 
15
+ facts = stringify_facts_hash(facts)
16
+
15
17
  field_size = MCollective::Util.field_size(facts.keys)
16
18
  facts.keys.sort.each do |k|
17
19
  printf(" %-#{field_size}s found %d times\n", k, facts[k].size)
@@ -28,6 +30,12 @@ class MCollective::Application::Facts<MCollective::Application
28
30
  end
29
31
  end
30
32
 
33
+ def stringify_facts_hash(facts)
34
+ res = Hash.new([])
35
+ facts.each { |k, v| res[k.to_s] += v }
36
+ res
37
+ end
38
+
31
39
  def main
32
40
  rpcutil = rpcclient("rpcutil")
33
41
  rpcutil.progress = false
@@ -10,7 +10,7 @@ module MCollective
10
10
 
11
11
  begin
12
12
  load_application(appname)
13
- rescue Exception # rubocop:disable Lint/RescueException
13
+ rescue Exception => e # rubocop:disable Lint/RescueException
14
14
  e.backtrace.first << Util.colorize(:red, " <----")
15
15
  STDERR.puts "Application '%s' failed to load:" % appname
16
16
  STDERR.puts
@@ -98,6 +98,7 @@ module MCollective
98
98
 
99
99
  # avoid option parsers own internal version handling that sux
100
100
  parser.on("-v", "--verbose")
101
+ parser.on("--version")
101
102
 
102
103
  if original_extra_opts
103
104
  begin
@@ -39,14 +39,6 @@ module MCollective
39
39
 
40
40
  begin
41
41
  case key
42
- when "registration"
43
- @registration = val.capitalize
44
- when "registration_collective"
45
- @registration_collective = val
46
- when "registerinterval"
47
- @registerinterval = Integer(val)
48
- when "registration_splay"
49
- @registration_splay = Util.str_to_bool(val)
50
42
  when "collectives"
51
43
  @collectives = val.split(",").map(&:strip)
52
44
  when "main_collective"
@@ -128,7 +120,7 @@ module MCollective
128
120
  @default_batch_size = Integer(val)
129
121
  when "default_batch_sleep_time"
130
122
  @default_batch_sleep_time = Float(val)
131
- when "topicprefix", "topicsep", "queueprefix", "rpchelptemplate", "helptemplatedir"
123
+ when "topicprefix", "topicsep", "queueprefix", "rpchelptemplate", "helptemplatedir", "registration_splay", "registerinterval", "registration_collective", "registration"
132
124
  Log.warn("Use of deprecated '#{key}' option. This option is ignored and should be removed from '#{configfile}'")
133
125
  else
134
126
  raise("Unknown config parameter '#{key}'")
@@ -149,7 +149,7 @@ module MCollective
149
149
 
150
150
  return true
151
151
  rescue => e
152
- raise DDLValidationError, "Cannot validate input %s: %s" % [key, e.to_s]
152
+ raise DDLValidationError, "Cannot validate input %s: %s" % [key, e.to_s], e.backtrace
153
153
  end
154
154
 
155
155
  # Registers an input argument for a given action
@@ -20,7 +20,9 @@ module MCollective
20
20
  @mcversion = mcdependency[:mcversion] || mcversion
21
21
  @metadata[:version] = (configuration[:version] || @metadata[:version])
22
22
  @dependencies << {:name => "#{@mcname}-common", :version => @mcversion}
23
+ @agent_name = @metadata[:name].downcase
23
24
  @metadata[:name] = (configuration[:pluginname] || @metadata[:name]).downcase.gsub(/\s+|_/, "-")
25
+
24
26
  identify_packages
25
27
  end
26
28
 
@@ -52,7 +54,7 @@ module MCollective
52
54
  agent[:plugindependency] = {:name => "#{@mcname}-#{@metadata[:name]}-common", :version => @metadata[:version], :revision => @revision}
53
55
 
54
56
  if @metadata[:provider] == "external"
55
- agent[:executable_files] << File.join(agentdir, @metadata[:name])
57
+ agent[:executable_files] << File.join(agentdir, @agent_name)
56
58
  end
57
59
 
58
60
  agent
@@ -60,9 +62,11 @@ module MCollective
60
62
 
61
63
  # Obtain client package files and dependencies.
62
64
  def client
63
- client = {:files => [],
64
- :dependencies => @dependencies.clone,
65
- :description => "Client plugin for #{@metadata[:name]}"}
65
+ client = {
66
+ :files => [],
67
+ :dependencies => @dependencies.clone,
68
+ :description => "Client plugin for #{@metadata[:name]}"
69
+ }
66
70
 
67
71
  clientdir = File.join(@path, "application")
68
72
  aggregatedir = File.join(@path, "aggregate")
@@ -169,6 +169,7 @@ module MCollective
169
169
  else
170
170
  config_paths << "/etc/puppetlabs/mcollective/client.cfg"
171
171
  config_paths << "/etc/mcollective/client.cfg"
172
+ config_paths << "/usr/local/etc/mcollective/client.cfg"
172
173
  end
173
174
 
174
175
  config_paths
@@ -188,22 +189,25 @@ module MCollective
188
189
  config_paths << File.join(choria_windows_prefix, "etc", "client.conf")
189
190
  else
190
191
  config_paths << "/etc/choria/client.conf"
192
+ config_paths << "/usr/local/etc/choria/client.conf"
191
193
  end
192
194
 
193
195
  config_paths
194
196
  end
195
197
 
196
- # Picks the default user config file, pririties are first Choria ones then old MCollective ones
198
+ # Picks the default user config file, priorities are first Choria ones then old MCollective ones
197
199
  #
198
200
  # In roughly this order, first to exist is used:
199
201
  #
200
202
  # - ~/.choriarc
201
203
  # - APPData/ChoriaIO/choria/etc/client.conf on windows
202
- # - /etc/choria/client.conf on unix
204
+ # - /etc/choria/client.conf then
205
+ # - /usr/local/etc/choria/client.conf on unix
203
206
  # - ~/.mcollective
204
207
  # - APPData/PuppetLabs/mcollective/etc/client.cfg on windows
205
208
  # - /etc/puppetlabs/mcollective/client.cfg
206
209
  # - /etc/mcollective/client.cfg
210
+ # - /usr/local/etc/mcollective/client.cfg
207
211
  def self.config_file_for_user
208
212
  config_paths = choria_config_paths_for_user + mcollective_config_paths_for_user
209
213
  found = config_paths.find_index { |file| File.readable?(file) } || 0
@@ -57,7 +57,7 @@ module MCollective
57
57
  Validator.load_validators
58
58
 
59
59
  begin
60
- if [:integer, :boolean, :float, :number, :string].include?(validation)
60
+ if [:integer, :boolean, :float, :number, :string, :array, :hash].include?(validation)
61
61
  Validator.typecheck(validator, validation)
62
62
 
63
63
  else
@@ -76,7 +76,7 @@ module MCollective
76
76
  end
77
77
  end
78
78
  rescue => e
79
- raise ValidatorError, e.to_s
79
+ raise ValidatorError, e.to_s, e.backtrace
80
80
  end
81
81
  end
82
82
  end
@@ -19,6 +19,10 @@ module MCollective
19
19
  validator.is_a?(String)
20
20
  when :boolean
21
21
  [TrueClass, FalseClass].include?(validator.class)
22
+ when :array
23
+ validator.is_a?(Array)
24
+ when :hash
25
+ validator.is_a?(Hash)
22
26
  else
23
27
  false
24
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: choria-mcorpc-support
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.20.7
4
+ version: 2.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - R.I.Pienaar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-26 00:00:00.000000000 Z
11
+ date: 2020-11-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu
@@ -36,14 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: 0.5.0
39
+ version: '0.6'
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
- version: 0.5.0
46
+ version: '0.6'
47
47
  description: Libraries enabling Ruby support for the Choria Orchestration Server
48
48
  email: rip@devco.net
49
49
  executables: