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 fragment target handling #318

Merged
merged 1 commit into from
May 28, 2015
Merged

Conversation

bmjen
Copy link
Contributor

@bmjen bmjen commented May 28, 2015

Needed to bind fragment targets to it's parent concat resource's title so that we can
find them in the catalog. Throws a warning if the target is not found.

# Check if either source or content is set. raise error if none is set
fail Puppet::ParseError, "Set either 'source' or 'content'" if self[:source].nil? && self[:content].nil?

# Check if both are set, if so rais error
fail Puppet::ParseError, "Can't use 'source' and 'content' at the same time" if !self[:source].nil? && !self[:content].nil?

self[:tag] = regsubst(self[:target], '[/:\n\s]', '_', 'GM') if self[:tag].nil?
Copy link
Contributor

Choose a reason for hiding this comment

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

doesn't this change the required-ness of tag? or at least change the default? May be a feature, should have docs, should maybe be split out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. forgot to remove that bit. Need to add a check in the validation block too.

Needed to bind fragment targets to it's parent concat resource's title so that we can
find them in the catalog. Throws a warning if the target is not found.
underscorgan pushed a commit that referenced this pull request May 28, 2015
fix fragment target handling
@underscorgan underscorgan merged commit e9ee044 into puppetlabs:2.0.x May 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants