Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AliasMatch directives #483

Merged
merged 1 commit into from
Nov 21, 2013

Conversation

antaflos
Copy link
Contributor

(#479) Extend the _aliases.erb template so that the list of hashes in
apache::vhost's aliases parameter can contain the usual alias
hashes but also aliasmatch hashes, which get translated to
AliasMatch directives.

Includes basic spec tests and updated documentation in README.md.

Note: The tests for this seem to fail on my machine because of what is probably a bug in rpsec-puppet. Will see what Travis says.

@antaflos
Copy link
Contributor Author

So this really fails the tests, but I don't understand what I could be doing wrong. Looking at https://travis-ci.org/puppetlabs/puppetlabs-apache/jobs/14232351#L1134 it seems rspec swallows up the $1 in /files/gifs/$1.gif:

...
{"aliasmatch"=>"^/image/(.*).gif", "path"=>"/files/gifs/$1.gif"}
...

becomes

...
  AliasMatch ^/image/(.*).gif /files/gifs/.gif
...

As you can see the path /files/gifs/$1.gif got messed up and rspec seems to see it as /files/gifs/.gif.

Or am I going crazy?

(puppetlabs#479) Extend the _aliases.erb template so that the list of hashes in
`apache::vhost`'s `aliases` parameter can contain the usual `alias`
hashes but also `aliasmatch` hashes, which get translated to
`AliasMatch` directives.

Includes basic spec tests and updated documentation in README.md. Note
that these spec tests are currently only skeletons because rspec-puppet
drops constructs like '$1'. See the entries marked XXX.
@antaflos
Copy link
Contributor Author

I updated the comment to disable those tests because the problem apparently really is that rspec-puppet drops $1 unconditionally.

igalic added a commit that referenced this pull request Nov 21, 2013
Add support for AliasMatch directives
@igalic igalic merged commit 5b92f91 into puppetlabs:master Nov 21, 2013
antaflos added a commit to antaflos/puppetlabs-apache that referenced this pull request Nov 25, 2013
Much like in PR puppetlabs#483 extend the _scriptalias.rb template so that the
`scriptalias` parameter in `apache::vhost` can contain `aliasmatch`
hashes which get translated to `ScriptAliasMatch` directives. Fixes
issue puppetlabs#480.

Includes basic spec tests and updated documentation in README.md.

Note again that puppet-rspec silently drops `$1` when specifying test
values so we match `FOO` instead of `$1`. From a simple spec test
perspective there shouldn't be a difference and this is better than
having no tests at all.
traylenator pushed a commit to traylenator/puppetlabs-apache that referenced this pull request Jun 7, 2022
(MODULES-9033) Fix failing acceptance tests on all platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants