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

Fix line breaks if not using arrays for ds. #52

Merged
merged 1 commit into from
Jun 23, 2015
Merged

Fix line breaks if not using arrays for ds. #52

merged 1 commit into from
Jun 23, 2015

Conversation

mrolli
Copy link
Contributor

@mrolli mrolli commented May 27, 2015

Fix missing line break if one does provide several hosts as string
instead of an array. Previously if using the template without a host
array the data sources got lined up on a single line.

Fix missing line break if one does provide several hosts as string
instead of an array. Previously if using the template without a host
array the data sources got lined up on a single line.
@mrolli
Copy link
Contributor Author

mrolli commented May 27, 2015

To illustrate. The following (defined in hiera):

ganglia::gmetad::clusters:
  - { name: 'H Nodes', address: 'hnode01 hnode15 hnode29' }
  - { name: 'J Nodes', address: 'jnode01 jnode15' }
  - { name: 'K Nodes', address: 'knode01 knode17' }

Ended up as:

data_source "H Nodes" hnode01 hnode15 hnode29data_source "J Nodes" jnode01 jnode15data_source "K Nodes" knode01 knode17

The above pull request fixes this.

@mrolli
Copy link
Contributor Author

mrolli commented Jun 2, 2015

Ping. Is this repo still relevant for you? I'd like to see this merged because I have another PR in the pipeline (featuring mcast_if).

@jhoblitt
Copy link
Owner

jhoblitt commented Jun 6, 2015

@mrolli Yes - this module is still actively maintained.

It was a conscious design decision that multiple addresses are specified as an array; scalar||array interchangeability is idiomatic puppet.

Could you provide a bit more detail about your concern about this syntax?

- { name: 'H Nodes', address: ['hnode01', 'hnode15', 'hnode29'] }

@mrolli
Copy link
Contributor Author

mrolli commented Jun 7, 2015

@jhoblitt Sorry for distracting you by using a string with several hosts in it. Yes, I could have used array notation, but that was not the point I wanted to illustrate. The point was, that when using string instead of array, the template produces a oneliner config instead of the correct one:

  - { 'name': 'E Nodes', 'address': 'enode01' }
  - { 'name': 'F Nodes', 'address': 'fnode01' }
  - { 'name': 'H Nodes', 'address': 'hnode01' }

leads to:

data_source "E Nodes" enode01data_source "F Nodes" fnode01data_source "H Nodes" hnode01

instead of:

data_source "E Nodes" enode01
data_source "F Nodes" fnode01
data_source "H Nodes" hnode01

So, the one minus has to be deleted within the else path to have the template produce the correct output in case the user is using strings aka setting only one server to fetch the data.

jhoblitt pushed a commit that referenced this pull request Jun 23, 2015
…-in-data-sources

Fix line breaks if not using arrays for ds.
@jhoblitt jhoblitt merged commit d6a089d into jhoblitt:master Jun 23, 2015
@mrolli mrolli deleted the bugfix/gmetad-template-line-breaks-in-data-sources branch June 24, 2015 06:37
@mrolli
Copy link
Contributor Author

mrolli commented Jun 24, 2015

Thanks for merging. Sorry, had to kill my fork. :-(

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

Successfully merging this pull request may close these issues.

2 participants