Closed alexjfisher closed 4 years ago
Looks like the regex in while db.empty? && version !~ /\d+\.0($|\.\d+)/
should handle this, but assumes the full version is being used. ie 3.9.0 not just 3.9. The spec tests for facterversion
suggest a version number without the revision part should work though.
Correction: the regex assumes a full version or a version with just MAJOR.MINOR. It does not cover the case where the version returned by down_facter_version
is incomplete though.
/\d+\.0($|\.\d+)/
also needs to be anchored or it matches 3.9.0
as 9.0
Whilst trying to downgrade the facter version, rspec-puppet-facts will hang if it can't find a suitable version.
An example from puppet-ipset module.
with
and metadata.json
Adding debug to https://github.com/mcanevet/rspec-puppet-facts/blob/4e07ec47787632ac3e3f8a8330ec074cc4b8905f/lib/rspec-puppet-facts.rb#L113 to print out
version
...The
down_facter_version
function is very simplistic. It only checks the minor version and doesn't check that it isn't already0
.