Skip to content

Commit

Permalink
Fix support for 'puppet generate types' (#7)
Browse files Browse the repository at this point in the history
This works around SERVER-94 issues

Puppet < 4.10.4 does not properly process the 'puppet generate types'
supporting composite namevars.

Closes #6
  • Loading branch information
trevor-vaughan authored May 9, 2018
1 parent a5e9704 commit 4e9ff96
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 19 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: required
rvm:
- 2.1.9
# Ruby with Puppet 5
- 2.4.0
- 2.4.4
notifications:
email:
- [email protected]
Expand All @@ -13,17 +13,17 @@ env:
# Test Puppet 4
- PUPPET=4.0 RUBY_AUGEAS=0.5
# Test Oldest Puppet, Inc. supported Puppet
- PUPPET=4.7.1 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
- PUPPET=4.10.4 RUBY_AUGEAS=0.5 FORGE_PUBLISH=true
# Test latest Puppet version
- PUPPET=5.0 RUBY_AUGEAS=0.5
- PUPPET=5.5 RUBY_AUGEAS=0.5

matrix:
fast_finish: true
exclude:
# base exclude
# No support for Ruby 2.1.9 in Puppet 5
- rvm: 2.1.9
env: PUPPET=5.0 RUBY_AUGEAS=0.5
env: PUPPET=5.5 RUBY_AUGEAS=0.5

install:
- "travis_retry ./.travis.sh"
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.0.0

- Fix support for 'puppet generate types'
- Remove misplaced stubs in spec tests
- Added CentOS and OracleLinux to supported OS list

## 2.0.2

- Upped supported Puppet versions to include Puppet 5
Expand Down
17 changes: 8 additions & 9 deletions lib/puppet/type/apache_directive.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,34 +56,33 @@ def insync?(is)
end

def self.title_patterns
identity = lambda { |x| x }
[
[
/^(\S+)\s+from\s+(\S+)\s+in\s+(.*)$/,
[
[ :name, identity ],
[ :context, identity ],
[ :target, identity ],
[ :name ],
[ :context ],
[ :target ],
]
],
[
/^(\S+)\s+from\s+(\S+)$/,
[
[ :name, identity ],
[ :context, identity ],
[ :name ],
[ :context ],
]
],
[
/^(\S+)\s+in\s+(.*)$/,
[
[ :name, identity ],
[ :target, identity ],
[ :name ],
[ :target ],
]
],
[
/(.*)/,
[
[ :name, identity ],
[ :name ],
]
]
]
Expand Down
20 changes: 18 additions & 2 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "herculesteam-augeasproviders_apache",
"version": "2.0.2",
"version": "3.0.0",
"author": "Dominic Cleal, Raphael Pinson",
"summary": "Augeas-based apache types and providers for Puppet",
"license": "Apache-2.0",
Expand Down Expand Up @@ -43,12 +43,28 @@
"6",
"7"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"4",
"5",
"6",
"7"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"6",
"7"
]
}
],
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 2.7.0 < 6.0.0"
"version_requirement": ">= 4.10.4 < 6.0.0"
}
]
}
2 changes: 0 additions & 2 deletions spec/unit/puppet/provider/apache_directive/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

require 'spec_helper'

FileTest.stubs(:exist?).returns false
FileTest.stubs(:exist?).with('/etc/apache2/apache2.conf').returns true
provider_class = Puppet::Type.type(:apache_directive).provider(:augeas)

describe provider_class do
Expand Down
2 changes: 0 additions & 2 deletions spec/unit/puppet/provider/apache_setenv/augeas_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

require 'spec_helper'

FileTest.stubs(:exist?).returns false
FileTest.stubs(:exist?).with('/etc/apache2/apache2.conf').returns true
provider_class = Puppet::Type.type(:apache_setenv).provider(:augeas)

describe provider_class do
Expand Down

0 comments on commit 4e9ff96

Please sign in to comment.