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 missing brackets for function call #2540

Merged
merged 4 commits into from
Apr 29, 2024
Merged

Add missing brackets for function call #2540

merged 4 commits into from
Apr 29, 2024

Conversation

gerlingsm
Copy link
Contributor

@gerlingsm gerlingsm commented Apr 4, 2024

Summary

Two brackets have been added around the arguments of the second scope.call_function

Additional Context

Add any additional context about the problem here.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

The problem here is or was that the argument was not passed correctly to the function "authz_core_config" and you then got an error message from it that an incorrect variable type was passed.
"parameter 'config' expects a Hash value, got Tuple"
thanks to @Hufschmidt for helping to find the error and solve the problem

For error reproduction it is sufficient to use "authz_core" in some way within a directory in a vhost.
For example as described in the ReadMe:

# * `Basic` - Specifies mod_authz_core parameters for particular directories in a virtual host directory
# ```puppet
# apache::vhost { 'sample.example.net':
# docroot => '/path/to/directory',
# directories => [
# {
# path => '/path/to/different/dir',
# auth_type => 'Basic',
# authz_core => {
# require_all => {
# 'require_any' => {
# 'require' => ['user superadmin'],
# 'require_all' => {
# 'require' => ['group admins', 'ldap-group "cn=Administrators,o=Airius"'],
# },
# },
# 'require_none' => {
# 'require' => ['group temps', 'ldap-group "cn=Temporary Employees,o=Airius"']
# }
# }
# }
# },
# ],
# }

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified. (For example puppet apply)

fix error "expects a Hash value, got Tuple"
thanks to @Hufschmidt
@gerlingsm gerlingsm requested review from bastelfreak, ekohl, smortex and a team as code owners April 4, 2024 14:51
@CLAassistant
Copy link

CLAassistant commented Apr 4, 2024

CLA assistant check
All committers have signed the CLA.

@bastelfreak
Copy link
Collaborator

@gerlingsm can you maybe add a unit test for this to ensure that this works now?

@gerlingsm
Copy link
Contributor Author

@gerlingsm can you maybe add a unit test for this to ensure that this works now?

I will try tomorrow or early next week yes.
However, this is my first pull request for a Puppet project and I haven't dealt with unit tests before....

@gerlingsm
Copy link
Contributor Author

@gerlingsm can you maybe add a unit test for this to ensure that this works now?

I will try tomorrow or early next week yes. However, this is my first pull request for a Puppet project and I haven't dealt with unit tests before....

@bastelfreak Could you have a look? Is that sufficient?

@ekohl ekohl merged commit fa92741 into puppetlabs:main Apr 29, 2024
41 of 42 checks passed
@gerlingsm gerlingsm deleted the fix/authz branch April 30, 2024 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants