choria-mcorpc-support 2.23.2 → 2.23.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eec95c87d792aa11ef19070212ddb9c9a049b958
4
- data.tar.gz: 6773d4503a617ffe984e536f789d8057f99794db
3
+ metadata.gz: 73c63dbc1dacba7b90acdba3141cfedd3731da11
4
+ data.tar.gz: 42cfc48d721f69b6ec805e71624a8b8cff0fc141
5
5
  SHA512:
6
- metadata.gz: 9795fbdcaf8a5d765186a73b9fd7a6e015faea9738340a0e86b31bf199ef865d38b8e95fea9c3398da0ff6ba69ff11cef5480fa28a48639ed41074f9aea75c7e
7
- data.tar.gz: 719dc3e9eb808fb6cd13b4b43124b9d83bcc15569b061c92f64b1905c639b37d0f86a2b56fa6f074671a3aaec647c995089d5bca26bce433ce93c5bd78dfeddb
6
+ metadata.gz: 2f5370f390815f5881473b6c0e482db4f821f88ecb2616e33af9aa29a91e1561f1306b24945b1df2fe9d7ad05f8f770908298cb9279ae6dedb90658906654454
7
+ data.tar.gz: 250ca8bb59baccda7324a4f21f7db4f938c6fc06cdfe968f46263e0fe11ba55214d237dda44a5db0243500007a8ffec856e336880334d5e0df3d2e53903499a9
@@ -53,7 +53,7 @@ module MCollective
53
53
  require "mcollective/util"
54
54
  require "mcollective/validator"
55
55
 
56
- VERSION = "2.23.2".freeze
56
+ VERSION = "2.23.3".freeze
57
57
 
58
58
  def self.version
59
59
  VERSION
@@ -1,71 +1,6 @@
1
1
  class MCollective::Application::Facts < MCollective::Application # rubocop:disable Style/ClassAndModuleChildren
2
2
  description "Reports on usage for a specific fact"
3
3
 
4
- def post_option_parser(configuration)
5
- configuration[:fact] = ARGV.shift unless ARGV.empty?
6
- end
7
-
8
- def validate_configuration(configuration)
9
- raise "Please specify a fact to report for" unless configuration.include?(:fact)
10
- end
11
-
12
- def show_single_fact_report(fact, facts, verbose=false)
13
- puts("Report for fact: #{fact}\n\n")
14
-
15
- facts = stringify_facts_hash(facts)
16
-
17
- field_size = MCollective::Util.field_size(facts.keys)
18
- facts.keys.sort.each do |k|
19
- printf(" %-#{field_size}s found %d times\n", k, facts[k].size)
20
-
21
- next unless verbose
22
-
23
- puts
24
-
25
- facts[k].sort.each do |f|
26
- puts(" #{f}")
27
- end
28
-
29
- puts
30
- end
31
- end
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
-
39
- def main
40
- rpcutil = rpcclient("rpcutil")
41
- rpcutil.progress = false
42
-
43
- facts = {}
44
-
45
- rpcutil.get_fact(:fact => configuration[:fact]) do |resp|
46
- begin
47
- value = resp[:body][:data][:value].to_s
48
-
49
- if resp[:body][:data].include?(:value)
50
- if facts.include?(value)
51
- facts[value] << resp[:senderid]
52
- else
53
- facts[value] = [resp[:senderid]]
54
- end
55
- end
56
- rescue Exception => e # rubocop:disable Lint/RescueException
57
- warn "Could not parse facts for #{resp[:senderid]}: #{e.class}: #{e}"
58
- end
59
- end
60
-
61
- if facts.empty?
62
- puts "No values found for fact #{configuration[:fact]}\n"
63
- else
64
- show_single_fact_report(configuration[:fact], facts, options[:verbose])
65
- end
66
-
67
- printrpcstats
68
-
69
- halt rpcutil.stats
70
- end
4
+ external(:command => "choria", :args => ["facts"])
5
+ external_help(:command => "choria", :args => ["facts", "--help"])
71
6
  end
@@ -283,6 +283,7 @@ module MCollective
283
283
  if pid.nil?
284
284
  Process.gid = Process.egid = u.gid
285
285
  Process.uid = Process.euid = u.uid
286
+ ENV.delete_if { |name| name !~ /^LC_/ }
286
287
  Process.exec(environment, command, options)
287
288
  end
288
289
  else
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.23.2
4
+ version: 2.23.3
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: 2021-01-12 00:00:00.000000000 Z
11
+ date: 2021-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: systemu