rspec-puppet-facts 1.9.1 → 1.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Rakefile +2 -0
- data/lib/rspec-puppet-facts.rb +14 -4
- data/lib/rspec-puppet-facts/version.rb +1 -1
- data/spec/rspec_puppet_facts_spec.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cc1e0c2d29c71210af4d52cd12eb0cf9be062dedd4a6eb59f931379acb12b57
|
4
|
+
data.tar.gz: b16313f97d45b158fec32cabf3e69519c28b64739964b9856249c24786f595a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0b3e3465f50d1a9b2b2043aede40cfdc4345c9bf3c6be392b7c9dd7b898b9f4a6352bfde02c5e74761b737a55cb20af6a60cb781c359d2d0108c959bf18be755
|
7
|
+
data.tar.gz: f5935b8d432442845fa5cd64490cc480ee46ebd341f6be3041f76e20dadc259395d41a28cbcf382531c1a4e27014d850751800afe4a6824f86d41ea773e03615
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
## 2018-10-24 - Release 1.9.2
|
2
|
+
- Catch the right `LoadError` on missing augeas gem. Thanks to [baurmatt](https://github.com/baurmatt) for the quick fix, and [rodjek](https://github.com/rodjek) for dealing with the testing
|
3
|
+
|
1
4
|
## 2018-10-24 - Release 1.9.1
|
2
5
|
- Do not rely on features of Augeas because Puppet 6
|
3
6
|
|
data/Rakefile
CHANGED
data/lib/rspec-puppet-facts.rb
CHANGED
@@ -216,15 +216,25 @@ module RspecPuppetFacts
|
|
216
216
|
:rubysitedir => RbConfig::CONFIG['sitelibdir'],
|
217
217
|
:rubyversion => RUBY_VERSION,
|
218
218
|
}
|
219
|
-
|
220
|
-
|
219
|
+
|
220
|
+
if augeas?
|
221
221
|
@common_facts[:augeasversion] = Augeas.open(nil, nil, Augeas::NO_MODL_AUTOLOAD).get('/augeas/version')
|
222
|
-
rescue => e
|
223
|
-
RspecPuppetFacts.warning "Failed to retrieve Augeas version: #{e}"
|
224
222
|
end
|
223
|
+
|
225
224
|
@common_facts
|
226
225
|
end
|
227
226
|
|
227
|
+
# Determine if the Augeas gem is available.
|
228
|
+
# @api private
|
229
|
+
# @return [Boolean] true if the augeas gem could be loaded.
|
230
|
+
def self.augeas?
|
231
|
+
require 'augeas'
|
232
|
+
true
|
233
|
+
rescue LoadError => e
|
234
|
+
RspecPuppetFacts.warning "Failed to retrieve Augeas version: #{e}"
|
235
|
+
false
|
236
|
+
end
|
237
|
+
|
228
238
|
# Get the "operatingsystem_support" structure from
|
229
239
|
# the parsed metadata.json file
|
230
240
|
# @raise [StandardError] if there is no "operatingsystem_support"
|
@@ -618,7 +618,7 @@ describe RspecPuppetFacts do
|
|
618
618
|
end
|
619
619
|
|
620
620
|
it 'should not add "augeasversion" if Augeas is supported' do
|
621
|
-
allow(
|
621
|
+
allow(described_class).to receive(:augeas?).and_return(false)
|
622
622
|
RspecPuppetFacts.reset
|
623
623
|
expect(subject.common_facts).not_to include :augeasversion
|
624
624
|
end
|
@@ -634,7 +634,7 @@ describe RspecPuppetFacts do
|
|
634
634
|
end
|
635
635
|
end
|
636
636
|
|
637
|
-
allow(
|
637
|
+
allow(described_class).to receive(:augeas?).and_return(true)
|
638
638
|
stub_const('Augeas', Augeas_stub)
|
639
639
|
RspecPuppetFacts.reset
|
640
640
|
expect(subject.common_facts[:augeasversion]).to eq 'my_version'
|