puppet_litmus 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/matrix_from_metadata_v2 +7 -5
- data/lib/puppet_litmus/inventory_manipulation.rb +4 -30
- data/lib/puppet_litmus/puppet_helpers.rb +217 -302
- data/lib/puppet_litmus/rake_helper.rb +83 -182
- data/lib/puppet_litmus/rake_tasks.rb +3 -8
- data/lib/puppet_litmus/version.rb +1 -1
- data/spec/exe/matrix_from_metadata_v2_spec.rb +3 -3
- data/spec/lib/puppet_litmus/puppet_helpers_spec.rb +0 -20
- data/spec/lib/puppet_litmus/rake_tasks_spec.rb +1 -1
- metadata +2 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f42320bf296d7e6efb9370a3e39b775a868417f9dc337aa7c5dee5052b055c6f
|
4
|
+
data.tar.gz: 607ab4fe445eb6f8b29d758212e84065b3e15b0273af85debec7676ea70c9115
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6abadc5c20561dd3f0db0b0bfcd96b55ba0df2e2fdfa97576fb48caabe538287ccb86750264fe10c0831b23e20f89d34946d4df2dd3cdf2e1e0adccb7d3f6538
|
7
|
+
data.tar.gz: f500ac82345c2c05abddf4e50d8c3492e37ef711b5c20a14fcda8d16ad6d5cecb13b64b43d343bd9e11eba242d80ef9584fa73f60fb36329c1b078d3c72f86bd
|
data/exe/matrix_from_metadata_v2
CHANGED
@@ -142,11 +142,13 @@ if metadata.key?('requirements') && metadata['requirements'].length.positive?
|
|
142
142
|
next unless Gem::Requirement.create(reqs).satisfied_by?(Gem::Version.new("#{collection[:puppet_maj_version]}.9999"))
|
143
143
|
|
144
144
|
matrix[:collection] << "puppet#{collection[:puppet_maj_version]}-nightly"
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
|
146
|
+
include_version = {
|
147
|
+
8 => "~> #{collection[:puppet_maj_version]}.0",
|
148
|
+
7 => "~> #{collection[:puppet_maj_version]}.24",
|
149
|
+
6 => "~> #{collection[:puppet_maj_version]}.0"
|
150
|
+
}
|
151
|
+
spec_matrix[:include] << { puppet_version: include_version[collection[:puppet_maj_version]], ruby_version: collection[:ruby_version] }
|
150
152
|
end
|
151
153
|
end
|
152
154
|
end
|
@@ -323,35 +323,9 @@ module PuppetLitmus::InventoryManipulation
|
|
323
323
|
# @param inventory_hash [Hash] hash of the inventory.yaml file
|
324
324
|
# @param node_name [String] node of nodes to limit the search for the node_name in
|
325
325
|
def add_platform_field(inventory_hash, node_name)
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
{}
|
331
|
-
end
|
332
|
-
Honeycomb.current_span.add_field('litmus.platform', facts&.dig('platform'))
|
333
|
-
end
|
334
|
-
|
335
|
-
# Add platform custom information field to the current span for each node being targeted.
|
336
|
-
# If more than one node is being targeted, each node will be given a separate custom field.
|
337
|
-
#
|
338
|
-
# @param span [Honeycomb::Span] The current span
|
339
|
-
# @param target_node_names [Array[String]] Nodes being targeted
|
340
|
-
# @param inventory_hash [Hash] Hash of the inventory.yaml file
|
341
|
-
def add_node_fields_to_span(span, target_node_names, inventory_hash)
|
342
|
-
node_counter = 1
|
343
|
-
Array(target_node_names).each do |target_name|
|
344
|
-
name_field = 'litmus.node_name'
|
345
|
-
platform_field = 'litmus.platform'
|
346
|
-
|
347
|
-
name_field = "#{name_field}_#{node_counter}"
|
348
|
-
platform_field = "#{platform_field}_#{node_counter}"
|
349
|
-
span.add_field(name_field, target_name)
|
350
|
-
if target_in_inventory?(inventory_hash, target_name)
|
351
|
-
facts = facts_from_node(inventory_hash, target_name)
|
352
|
-
span.add_field(platform_field, facts&.dig('platform')) unless facts.nil?
|
353
|
-
end
|
354
|
-
node_counter += 1
|
355
|
-
end
|
326
|
+
facts_from_node(inventory_hash, node_name)
|
327
|
+
rescue StandardError => e
|
328
|
+
warn e
|
329
|
+
{}
|
356
330
|
end
|
357
331
|
end
|