quixoten-puppetdb-terminus 4.1.4 → 4.2.0

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: 4c979a664e0ae9fde455ab3266b9d24119ce36d0
4
- data.tar.gz: 67df011009b136ab2f3bb30f5456f5ee2e7211fc
3
+ metadata.gz: 93220f6328754655b285f6d872685c35ea0ff0cf
4
+ data.tar.gz: 2f6c23b5d200ebe83820bf8ec508f802a87dbccb
5
5
  SHA512:
6
- metadata.gz: e60b39c6042a2dec6fc0501bada19f2825d12a645b7127b56e5125188351b5196ed9b99304b49ec96315f82c570e1a322fc1de3ded542abd55b009165964d5aa
7
- data.tar.gz: b510d00965fc5847dbdc058d7789940c3c70cdf078b183502f57456924cf2fbeeca9c9ba181c53e5ee7a7c08e8c847d5a4efaa0b1ec23055688f876b7209ce3b
6
+ metadata.gz: bfff5198cfe35a6d3a8265dc268baf0ce60f9b65f52a76eca95efd2a8682324c1c7832484ebe546f58cc86ba9cf2cd72931be945abf18ecfb4951a5dd457ce16
7
+ data.tar.gz: fef9494f3a6ed3c6868f09c3b12c1301dc17422c8b7c2d42d0b1c397ca8bf897ea855daef3d39a601c3c318d34b48be0a90d67e4760223a4bc5dee7ca3ea37fd
@@ -10,7 +10,7 @@ class Puppet::Resource::Catalog::Puppetdb < Puppet::Indirector::REST
10
10
  def save(request)
11
11
  profile("catalog#save", [:puppetdb, :catalog, :save, request.key]) do
12
12
  catalog = munge_catalog(request.instance, extract_extra_request_data(request))
13
- submit_command(request.key, catalog, CommandReplaceCatalog, 8)
13
+ submit_command(request.key, catalog, CommandReplaceCatalog, 9)
14
14
  end
15
15
  end
16
16
 
@@ -53,6 +53,7 @@ class Puppet::Resource::Catalog::Puppetdb < Puppet::Indirector::REST
53
53
  add_transaction_uuid(data, extra_request_data[:transaction_uuid])
54
54
  add_environment(data, extra_request_data[:environment])
55
55
  add_producer_timestamp(data, extra_request_data[:producer_timestamp])
56
+ add_producer(data, Puppet[:node_name_value])
56
57
 
57
58
  data
58
59
  end
@@ -142,6 +143,18 @@ class Puppet::Resource::Catalog::Puppetdb < Puppet::Indirector::REST
142
143
  hash
143
144
  end
144
145
 
146
+ # Include producer in hash, returning the complete hash.
147
+ #
148
+ # @param hash [Hash] original data hash
149
+ # @param producer [String or nil] producer
150
+ # @return [Hash] returns original hash augmented with producer
151
+ # @api private
152
+ def add_producer(hash, producer)
153
+ hash['producer'] = producer
154
+
155
+ hash
156
+ end
157
+
145
158
  # Version is an integer (time since epoch in millis). The wire
146
159
  # format specifies version should be a string
147
160
  #
@@ -31,10 +31,11 @@ class Puppet::Node::Facts::Puppetdb < Puppet::Indirector::REST
31
31
  # legacy storeconfigs.
32
32
  "environment" => request.options[:environment] || request.environment.to_s,
33
33
  "producer_timestamp" => request.options[:producer_timestamp] || Time.now.iso8601(5),
34
+ "producer" => Puppet[:node_name_value]
34
35
  }
35
36
  end
36
37
 
37
- submit_command(request.key, payload, CommandReplaceFacts, 4)
38
+ submit_command(request.key, payload, CommandReplaceFacts, 5)
38
39
  end
39
40
  end
40
41
 
@@ -19,7 +19,7 @@ Puppet::Reports.register_report(:puppetdb) do
19
19
  # @return [void]
20
20
  def process
21
21
  profile("report#process", [:puppetdb, :report, :process]) do
22
- submit_command(self.host, report_to_hash, CommandStoreReport, 7)
22
+ submit_command(self.host, report_to_hash, CommandStoreReport, 8)
23
23
  end
24
24
 
25
25
  nil
@@ -38,12 +38,14 @@ Puppet::Reports.register_report(:puppetdb) do
38
38
  end
39
39
 
40
40
  resources = build_resources_list
41
- is_noop = resources.any? { |rs| has_noop_event?(rs) } && resources.none? { |rs| has_enforcement_event?(rs) }
42
-
41
+ is_noop = defined?(noop) ? noop : resources.any? { |rs| has_noop_event?(rs) } && resources.none? { |rs| has_enforcement_event?(rs) }
43
42
 
44
43
  defaulted_catalog_uuid = defined?(catalog_uuid) ? catalog_uuid : transaction_uuid
45
44
  defaulted_code_id = defined?(code_id) ? code_id : nil
46
45
  defaulted_cached_catalog_status = defined?(cached_catalog_status) ? cached_catalog_status : nil
46
+ defaulted_noop_pending = defined?(noop_pending) ? noop_pending : nil
47
+ defaulted_corrective_change = defined?(corrective_change) ? corrective_change : nil
48
+
47
49
  {
48
50
  "certname" => host,
49
51
  "puppet_version" => puppet_version,
@@ -56,12 +58,15 @@ Puppet::Reports.register_report(:puppetdb) do
56
58
  "transaction_uuid" => transaction_uuid,
57
59
  "status" => status,
58
60
  "noop" => is_noop,
61
+ "noop_pending" => defaulted_noop_pending,
62
+ "corrective_change" => defaulted_corrective_change,
59
63
  "logs" => build_logs_list,
60
64
  "metrics" => build_metrics_list,
61
65
  "resources" => resources,
62
66
  "catalog_uuid" => defaulted_catalog_uuid,
63
67
  "code_id" => defaulted_code_id,
64
68
  "cached_catalog_status" => defaulted_cached_catalog_status,
69
+ "producer" => Puppet[:node_name_value]
65
70
  }
66
71
  end
67
72
  end
@@ -151,12 +156,14 @@ Puppet::Reports.register_report(:puppetdb) do
151
156
  # @return Hash[<String, Object>]
152
157
  # @api private
153
158
  def event_to_hash(event)
159
+ corrective_change = defined?(event.corrective_change) ? event.corrective_change : nil
154
160
  {
155
161
  "status" => event.status,
156
162
  "timestamp" => Puppet::Util::Puppetdb.to_wire_time(event.time),
157
163
  "property" => event.property,
158
164
  "new_value" => event.desired_value,
159
165
  "old_value" => event.previous_value,
166
+ "corrective_change" => corrective_change,
160
167
  "message" => event.message,
161
168
  }
162
169
  end
@@ -174,15 +181,17 @@ Puppet::Reports.register_report(:puppetdb) do
174
181
  # @return Hash[<String, Object>]
175
182
  # @api private
176
183
  def resource_status_to_hash(resource_status)
184
+ defaulted_corrective_change = defined?(resource_status.corrective_change) ? resource_status.corrective_change : nil
177
185
  {
178
- "skipped" => resource_status.skipped,
179
- "timestamp" => Puppet::Util::Puppetdb.to_wire_time(resource_status.time),
180
- "resource_type" => resource_status.resource_type,
181
- "resource_title" => resource_status.title.to_s,
182
- "file" => resource_status.file,
183
- "line" => resource_status.line,
184
- "containment_path" => resource_status.containment_path,
185
- "events" => build_events_list(resource_status.events),
186
+ "skipped" => resource_status.skipped,
187
+ "timestamp" => Puppet::Util::Puppetdb.to_wire_time(resource_status.time),
188
+ "resource_type" => resource_status.resource_type,
189
+ "resource_title" => resource_status.title.to_s,
190
+ "file" => resource_status.file,
191
+ "line" => resource_status.line,
192
+ "containment_path" => resource_status.containment_path,
193
+ "corrective_change" => defaulted_corrective_change,
194
+ "events" => build_events_list(resource_status.events),
186
195
  }
187
196
  end
188
197
 
@@ -1,6 +1,6 @@
1
1
  module PuppetDB
2
2
  module Terminus
3
- VERSION = "4.1.4"
3
+ VERSION = "4.2.0"
4
4
  UPSTREAM_VERSION = VERSION.split(".")[0..2].join(".")
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quixoten-puppetdb-terminus
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.4
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devin Christensen