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

InSpec provisioner is dropping the attributes property #172

Closed
elasticdog opened this issue Mar 28, 2019 · 3 comments
Closed

InSpec provisioner is dropping the attributes property #172

elasticdog opened this issue Mar 28, 2019 · 3 comments
Labels
Milestone

Comments

@elasticdog
Copy link

packerlicious version

1.4.0 -> 1.4.1

Expected behavior

The provided attributes property should end up in the final provisioner configuration:

>>> from packerlicious import builder, provisioner, Template
>>> template = Template()
>>> template.add_provisioner(
...     provisioner.Inspec(
...         attributes=["examples/linux.yml"],
...         profile="https://github.com/dev-sec/linux-baseline"
...     )
... )
<packerlicious.provisioner.Inspec object at 0x10f75e898>
>>> print(template.to_json())
{
  "provisioners": [
    {
      "attributes": ["examples/linux.yml"],
      "profile": "https://github.com/dev-sec/linux-baseline",
      "type": "inspec"
    }
  ]
}

Actual behavior

The provided attributes property is silently discarded in the final provisioner configuration:

>>> from packerlicious import builder, provisioner, Template
>>> template = Template()
>>> template.add_provisioner(
...     provisioner.Inspec(
...         attributes=["examples/linux.yml"],
...         profile="https://github.com/dev-sec/linux-baseline"
...     )
... )
<packerlicious.provisioner.Inspec object at 0x10f75e898>
>>> print(template.to_json())
{
  "provisioners": [
    {
      "profile": "https://github.com/dev-sec/linux-baseline",
      "type": "inspec"
    }
  ]
}

Steps to reproduce

See above...

mayn added a commit that referenced this issue Mar 29, 2019
…eventing "attributes" property name from being used/rendered by packerlicious classes
@mayn mayn added the bug label Mar 29, 2019
@mayn mayn added this to the 1.4.2 milestone Mar 29, 2019
@mayn mayn closed this as completed in 0d031f5 Mar 29, 2019
@mayn
Copy link
Owner

mayn commented Mar 29, 2019

thanks @elasticdog, v1.4.2 released to address this issue.

@elasticdog
Copy link
Author

@mayn wow, thank you for the amazing turn around! I had poked around the code and didn't see anything obvious jump out at me...never would have thought that the troposphere code would cause a conflict.

@mayn
Copy link
Owner

mayn commented Mar 29, 2019

@elasticdog yeah no problem.
It looks like the name conflict is because of the similarities between packer and python PEP8 naming convention (use of snake_case).

troposphere project is not affected because AWS cloudformation uses a naming convention closer to PascalCase while troposphere is snake_case.
So the props definitions would never overlap the python code that is used to dynamically generate itself (they would just be set on the object as attributes using PascalCase)

Pretty cool bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants