Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Henrik Lindberg commented on HI-296 Re: hiera merging: remove values when :merge_behavior is set to deeper If I misunderstood something (this is a feature also missing in hiera 5) please open a ticket for the PUP project since hiera 5 is now in the puppet code base, not in the separate HI project which remains to be only for the deprecated hiera 3. Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Henrik Lindberg commented on HI-296 Re: hiera merging: remove values when :merge_behavior is set to deeper With hiera 5 there is now much better control over how merges are performed. This ticket is for the old, now deprecated hiera 3. Closing this with "Won't Do". Add Comment This message was sent by Atlassian JIRA (v6.4.14#64029-sha1:ae256fe) -- You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at https://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Rob Nelson commented on HI-296 Re: hiera merging: remove values when :merge_behavior is set to deeper Andreas, Are you familiar with github and pull requests? The hiera project is located at https://github.com/puppetlabs/hiera, you can click fork in the top right and create a pull request against the master branch. For reference, the file and lines you are mentioning are located at https://github.com/puppetlabs/hiera/blob/99cdcdd828dff27f688ed4e0da331b12de760eb2/lib/hiera/backend.rb#L175-L184. Submitting a PR is the best way to share your patch, allow automated testing, and allow the project maintainers to accept the patch if all tests succeed. If you are unfamiliar with the process, you can get help on freenode IRC channel #puppet-dev and someone will be able to give you some specific assistance. Add Comment This message was sent by Atlassian JIRA (v6.3.10#6340-sha1:7ea293a) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Andreas Papst updated an issue Hiera / HI-296 hiera merging: remove values when :merge_behavior is set to deeper Change By: Andreas Papst Attachment: backend.rb.patch Attachment: backend.rb.example Add Comment This message was sent by Atlassian JIRA (v6.3.7#6337-sha1:2ed701e) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Andreas Papst updated an issue Hiera / HI-296 hiera merging: remove values when :merge_behavior is set to deeper Change By: Andreas Papst Aim:WithdeepermergingofHieradefinedhashesitshouldbepossibletoremovepreviouslydefinedhash-values.Thistinypatchfulfillsthisimposition:Patch/usr/lib/ruby/vendor_ruby/hiera/backend.rbwith--- {noformat} ---orig/backend.rb+++improvement/backend.rb@@-173,6+173,16@@#:deeper=UseHash.deep_merge!#defmerge_answer(left,right)+ifConfig[:merge_exclude_string]+caseConfig[:merge_behavior]+when:deeper,'deeper'+left.deep_merge!(right,{:knockout_prefix=Config[:merge_exclude_string]})+when:deep,'deep'+left.deep_merge(right,{:knockout_prefix=Config[:merge_exclude_string]})+else#Nativeandundefined+left.merge(right)+end+elsecaseConfig[:merge_behavior]when:deeper,'deeper'left.deep_merge!(right)@@-181,6+191,7@@else#Nativeandundefinedleft.merge(right)end+endend#Callsouttoallconfiguredbackendsintheorderthey {noformat} ---(Pleasebegenerous,thesearemyfirstlinesrubycode)Thusanewhiera.yamlkeyisintroduced::merge_exclude_stringIt'svalueisusedasforoption:knockout_prefixintheunderlyingrubymoduledeep_merge(https://github.com/danielsdeleo/deep_merge)toremovearrayentriesandhashvalues.Usageof:merge_exclude_stringinthehashtobemerged:./Ahashvalueprefixedwith:merge_exclude_stringwillbecomeanemptystring./The:merge_exclude_stringusedaloneresultsinanemptystringashashvalue,allvaluesdefinedpreviouslywillbecomedeleted../Anarraymemberprefixedwith:merge_exclude_stringwillberemovedfromthearray../The:merge_exclude_stringusedaloneasanarraymemberwillgiveanemptyarray../Anyvalueorarray-memberprefixedwith:merge_exclude_stringwillnotbeincludedevenifitwasnotdefinedpreviously../Mergingdifferenttypesofvalueswillcausethedeletionofthepreviouslydefinedvalueasitwasbefore.Example:/tmp/hieradata/hiera.yaml:-- {noformat} ---:backends:-yaml:yaml::datadir:/tmp/hieradata:hierarchy:-replace-common:merge_behavior:deeper:merge_exclude_string:'--' {noformat} --/tmp/hieradata/common.yaml:-- {noformat} ---K:KA:KA1:valA1KA2:valA2KA3:valA3KA4:valA4KB:KB1:valB1KB2:to_be_removed_valB2KB3:valB3KB4:valB4KC:KC1:valC1KC2:valC2KC3:valC3KC4:valC4KD:KD1:-array_member_D1-array_member_D2-array_member_D3-array_member_D4KE:KE1:-array_member_E1-to_be_removed_array_member_E2-array_member_E3-array_member_E4KF:KF1:-all_to_be_removed_array_member_F1-all_to_be_removed_array_member_F2-all_to_be_removed_array_member_F3-all_to_be_removed_array_member_F4KG:KG1:-all_to_be_removed_array_member_G1-all_to_be_removed_array_member_G2-all_to_be_removed_array_member_G3-all_to_be_removed_array_member_G4KH:KH1:-all_to_be_removed_array_member_H1-all_to_be_removed_array_member_H2-all_to_be_removed_array_member_H3-all_to_be_removed_array_member_H4 {noformat} --/tmp/hieradata/replace.yaml:-- {noformat}
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Andreas Papst commented on HI-296 Re: hiera merging: remove values when :merge_behavior is set to deeper Hi Rob, I hope this meets your requirements now. best wishes Add Comment This message was sent by Atlassian JIRA (v6.3.7#6337-sha1:2ed701e) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Rob Nelson commented on HI-296 Re: hiera merging: remove values when :merge_behavior is set to deeper Andreas, Have you submitted a PR against hiera? Also, can you reference that PR instead of including the patch and clean up the other output if it's not included in the PR? The lack of proper formatting makes it difficult to read. You can wrap blocks in { noformat } (without the spaces) before and after, that may help. Add Comment This message was sent by Atlassian JIRA (v6.3.7#6337-sha1:2ed701e) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title navneet batth assigned an issue to navneet batth Hiera / HI-296 hiera merging: remove values when :merge_behavior is set to deeper Change By: navneet batth Assignee: navneetbatth Add Comment This message was sent by Atlassian JIRA (v6.1.4#6159-sha1:44eaede) -- You received this message because you are subscribed to the Google Groups Puppet Bugs group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-bugs+unsubscr...@googlegroups.com. To post to this group, send email to puppet-bugs@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-bugs. For more options, visit https://groups.google.com/d/optout.
Jira (HI-296) hiera merging: remove values when :merge_behavior is set to deeper
Title: Message Title Andreas Papst created an issue Hiera / HI-296 hiera merging: remove values when :merge_behavior is set to deeper Issue Type: Improvement Affects Versions: HI 1.3.4 Assignee: Unassigned Created: 08/Oct/14 5:58 AM Environment: could solve Feature-Request #18793 ruby 1.9 Fix Versions: HI 1.3.4 Priority: Normal Reporter: Andreas Papst Aim: With deeper merging of Hiera defined hashes it should be possible to remove previously defined hash-values. This tiny patch fulfills this imposition: Patch /usr/lib/ruby/vendor_ruby/hiera/backend.rb with --- — orig/backend.rb +++ improvement/backend.rb @@ -173,6 +173,16 @@ :deeper = Use Hash.deep_merge! # def merge_answer(left,right) + if Config[:merge_exclude_string] + case Config[:merge_behavior] + when :deeper,'deeper' + left.deep_merge!(right, {:knockout_prefix =