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

types: Fix purging when section contains '//' #96

Merged
merged 1 commit into from
Mar 6, 2017

Conversation

jameslikeslinux
Copy link
Contributor

A change made in 0fe96f7 to support section headings of the form:

foo://bar

broke purging, where the underlying inifile type generates resources
with titles like:

section/setting

When a resource is generated with a title 'foo://bar/setting', the
setting name is not parsed. This is the case with inputs which often
take on the form:

[monitor:///var/log/messages]
setting1 = value1
setting2 = value2

The result is an error message: "Error:
/Stage[main]/Splunk::Params/Splunk_config[splunk]: Failed to generate
additional resources using 'generate': Got nil value for setting." See:
issue #69.

This change looks for additional slashes beyond the '://' and will
parse out the following string as the setting name.

This is not very satisfying because it could break a theoretical section
name containing extra slashes, but I have not come across that before,
and the [monitor:///../../../] case is very common.

@roidelapluie
Copy link
Member

Travis did not run.

@jameslikeslinux
Copy link
Contributor Author

Fixed--just minor rubocop violations.

A change made in 0fe96f7 to support section headings of the form:

```
foo://bar
```

broke purging, where the underlying inifile type generates resources
with titles like:

```
section/setting
```

When a resource is generated with a title 'foo://bar/setting', the
setting name is not parsed.  This is the case with inputs which often
take on the form:

```
[monitor:///var/log/messages]
setting1 = value1
setting2 = value2
```

The result is an error message: "Error:
/Stage[main]/Splunk::Params/Splunk_config[splunk]: Failed to generate
additional resources using 'generate': Got nil value for setting."  See:
issue voxpupuli#69.

This change looks for additional slashes beyond the '://' and will
parse out the following string as the setting name.

This is not very satisfying because it could break a theoretical section
name containing extra slashes, but I have not come across that before,
and the `[monitor:///../../../]` case is **very** common.
@roidelapluie roidelapluie merged commit 64f136d into voxpupuli:master Mar 6, 2017
@roidelapluie
Copy link
Member

Thanks!

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