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

Fixes #549: Unable to define a multi-value type #604

Merged
merged 1 commit into from
Feb 12, 2017

Conversation

jkroepke
Copy link
Contributor

Hi,

this pr implement #549 in a dirty way. It should be refactor if puppet 3 is dropped. (voxpupuli/plumbing#21 hopefully gets voted in the near feature... )

If you reject this because inline_template is not the state of the art I rewrite it to own defines for every type definition.

@juniorsysadmin
Copy link
Member

Full marks for the attempt, but whenever I see code that makes me want to scrub my hands thoroughly, I start wondering about wholesale refactoring. Can we completely redo this defined type to make things easier to read and easier to maintain (regardless of Puppet 4 types)?

@jkroepke
Copy link
Contributor Author

loop in puppet 3 does not really exists. I have to use inline_templates. Or should I code a define or every type definition?

@juniorsysadmin juniorsysadmin added needs-feedback Further information is requested and removed question labels Jan 1, 2017
@jkroepke
Copy link
Contributor Author

@juniorsysadmin Any news about this?

@bastelfreak
Copy link
Member

Hi @jkroepke, we dropped puppet3 in master. if you want you can migrate this PR to a puppet4 only codebase.

@juniorsysadmin juniorsysadmin removed the needs-feedback Further information is requested label Jan 30, 2017
@bastelfreak
Copy link
Member

ping @jkroepke

@jkroepke
Copy link
Contributor Author

@bastelfreak Looks like I forgot to send my question...

What about epp templates? Can I use them instead erb files?

@bastelfreak
Copy link
Member

yep sure!

@jkroepke
Copy link
Contributor Author

Fine. Then I will start it.

@jkroepke
Copy link
Contributor Author

Okay, I have refactor this type. I'm using puppter 4 validations now.

Additions Info:

  • I do a BC breaking change here:
    ds_type must be uppercase now. Otherwise, puppet throw an error.

@bastelfreak bastelfreak added backwards-incompatible bug Something isn't working labels Feb 12, 2017
@jkroepke
Copy link
Contributor Author

Additionally, the new travis the tests confused me. While the spec tests running file, the Coverage tests are failed. Its related to my PR?

@bastelfreak
Copy link
Member

@jkroepke we now run the tests in parallel, so the output might be a bit confusing. The original error is here: https://travis-ci.org/voxpupuli/puppet-collectd/jobs/200868572#L1360-L1366
and not related to coverage reports.

@jkroepke
Copy link
Contributor Author

Thanks. I squashed my commits and add a spec test for define multiple types.

max => Variant[Numeric, Enum['U']],
ds_type => Enum['ABSOLUTE', 'COUNTER', 'DERIVE', 'GAUGE'],
ds_name => String,
}]] $types = [],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this line is a bit too much whitespace?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bastelfreak I'm missing a guideline for the parameter layout w/ puppet data type definition. The reason for the much whitespace is to have all parameter variables in one vertical line. But I don't know, if it's fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, now I understand the layout. I'm not aware of any current best practices for the layout, we will keep this as is.

@bastelfreak
Copy link
Member

@jkroepke thanks for the work! If I understand this correctly it is still backwardscompatible (then I can remove the label)? Plese check the one line with the whitespace, afterwards I can merge + do a release.

@jkroepke
Copy link
Contributor Author

@bastelfreak technically no, because ds_type must be an uppercase now.

In 5.x release lowercase values are accepted, too. (And transfor to uppercase)

@bastelfreak bastelfreak merged commit dd182b4 into voxpupuli:master Feb 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompatible bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants