summaryrefslogtreecommitdiff
path: root/lib/chef/node_map.rb
Commit message (Collapse)AuthorAgeFilesLines
* Rename Attribute Whitelist/Blacklist to Allowlist/BlocklistTim Smith2020-07-231-16/+16
| | | | | | This is an overdue change. These are not terms we should be using as a company or community. To quote our Code of Conduct (https://community.chef.io/code-of-conduct/). "Be careful in the words that you choose. Be kind to others. Practice empathy." This change aims to do exactly that, while maintaining a level of backwards compatibility so we can transition existing users off the legacy configs. Signed-off-by: Tim Smith <tsmith@chef.io>
* Fix warning message for cb / core resource conflictTim Smith2020-07-061-2/+5
| | | | | | | Update the message to reflect what's actually happening, remove the evil double space after the period, and use branding. Signed-off-by: Tim Smith <tsmith@chef.io>
* Remove copyright dateslcg/remove-copyright-datesLamont Granquist2020-04-131-1/+1
| | | | | | | | Legally incredibly dubious, particularly since we don't follow it strictly as policy, and we have git history instead, which does it right. This is just a waste of time and a cargo cult. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove more canonical wiring from the node maplcg/remove-canonical-dslLamont Granquist2020-03-051-32/+6
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Add chef-utils gem with various recipe DSL helpersLamont Granquist2019-11-081-4/+17
| | | | | | | | | | | | | This is the implementation of [RFC-087](https://github.com/chef-boneyard/chef-rfc/blob/master/rfc087-distro-sugar-helpers.md) although some of the specifics have been iterated on and changed. The documentation will be in the [README.md](https://github.com/chef/chef/tree/master/chef-utils/README.md) once this is merged. While this PR mostly moves chef-sugar utilities into core-chef via this chef-utils gem, the scope of the chef-utils gem should be considered larger than just that. As an example this PR moves the Mash class into this gem for reuse in ohai as well. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Style/NegatedIfLamont Granquist2019-07-051-3/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/EmptyLineAfterGuardClauseLamont Granquist2019-07-021-0/+15
| | | | | | | i like this one, gives visual priority to returns or raises that are buried in the middle of things. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Target mode for systemd service helperLamont Granquist2019-05-291-2/+0
| | | | | | | | | | Makes it so that local cookbook can bounce a remote service over train/ssh/whatever. Works at least for ubuntu. Introduces a fairly rudimentary TrainHelpers class, using some inspiration from ohbye. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Remove resource collision deprecationsLamont Granquist2019-05-071-24/+5
| | | | | | | Switch to only doing warnings. Remove the features in the node_map that we never used. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Target Mode initial implementationBryan McLellan2019-05-061-2/+15
| | | | Signed-off-by: Bryan McLellan <btm@chef.io>
* changes for rubocop engine upgrades.lcg/rubocop-upgradesLamont Granquist2019-01-151-2/+2
| | | | | | | this is the result of changes to rules we already previously had enabled. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* replace "core" with "the client"lcg/better-deprecationLamont Granquist2018-08-291-2/+2
| | | | | | because users don't grok "core" Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* tighten up the description hereLamont Granquist2018-08-291-10/+4
| | | | | | the wall of words hurts more than it helps. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add rdoc and testsLamont Granquist2018-08-061-0/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add chef_version API to provides linesLamont Granquist2018-08-031-1/+5
| | | | | | also adds the chef_version_for_provides helper method Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Style/PreferredHashMethodsLamont Granquist2018-07-021-2/+2
| | | | | | | absolutely hard requirement on the fixes that went into chef-config 2.2.11, so the floor of that gem is bumped up. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix Layout/IndentHeredocLamont Granquist2018-07-021-12/+12
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Feed the Rubocop.Noah Kantrowitz2018-06-141-3/+3
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Improve the warning message shown for node map collisions.Noah Kantrowitz2018-06-141-2/+17
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Switch map collisions to a dedicated deprecation type so they can be ↵Noah Kantrowitz2018-06-141-2/+2
| | | | | | silenced easily. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Fix typo.Noah Kantrowitz2018-06-051-1/+1
| | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Feed the rubocop.Noah Kantrowitz2018-06-051-8/+8
| | | | | | Explicitly ignoring UnderscorePrefixedVariableName because we want __core_override__ to be an obviously unusual thing. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Fix up the thing namer.Noah Kantrowitz2018-06-051-1/+8
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* Add in version ranges too.Noah Kantrowitz2018-06-051-3/+11
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* First pass on an implementation for https://github.com/chef/chef-rfc/pull/305Noah Kantrowitz2018-06-051-1/+45
| | | | Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
* add specsLamont Granquist2018-02-131-0/+3
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* add Chef::NodeMap#delete_class APILamont Granquist2018-02-121-0/+23
| | | | | | | | halite needs this public API in order to not be so brittle. needs tests... Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Convert node map to last-writer-wins for tiesLamont Granquist2018-01-221-23/+5
| | | | | | | | | | | | We still bind preferentially by specificity, but for ties with specificity we now prefer last-writer-wins instead of the alphabetic by class name method we had before (that was never documented and I'm pretty certain nobody understood). So now `provides(:whatever) { true }` in a cookbook should always win over core. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix priority array orderlcg/cleanup-node-mapLamont Granquist2017-12-081-2/+4
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* simplify node_map logicLamont Granquist2017-12-081-32/+31
| | | | | | | flattens out the internal data structure and removes some excessive defensive coding. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix alphabetic sorting of classeslcg/node-map-speedupLamont Granquist2017-12-071-8/+6
| | | | | | but we really shouldn't do this... Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove yields and handle common cases earlyLamont Granquist2017-12-071-20/+15
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* a typoLamont Granquist2017-12-071-1/+1
| | | | Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* speedup node_map get and set operationsLamont Granquist2017-12-071-7/+31
| | | | | | | | this is the flip side of what was making the old tests so slow and this change will actually speedup customer runs by short-circuiting some operations. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* fix NodeMap to not throw exceptions on platform_versionslcg/nodemap-platform-versionsLamont Granquist2017-11-281-1/+1
| | | | | | | | Chef::Version and VersionConstraint are for x.y/x.y.z cookbook versions, and are always wrong for anything other than cookbooks. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Chef-13: remove node_map back-compatLamont Granquist2017-03-201-5/+2
| | | | | | removes old Chef-10 era APIs that were not widely used. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* remove Chef::Platform::HandlerMaplcg/remove-chef-platform-handler-classLamont Granquist2016-12-081-2/+18
| | | | | | seems like an entirely unnecessary level of indirection Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
* Structure deprecations with additional metadatatm/deprecation_with_urlThom May2016-11-161-2/+2
| | | | | | | | This adds URLs to each class of deprecation, and correctly prints and formats them for maximum user efficiency. We also provide the URL to the data collector for Visibility to ingest. Signed-off-by: Thom May <thom@chef.io>
* autofixing whitespace copsLamont Granquist2016-02-051-7/+7
| | | | | | | | | | | | | | | | | | | | | | 4174 Style/SpaceInsideHashLiteralBraces 1860 Style/SpaceAroundOperators 1336 Style/SpaceInsideBlockBraces 1292 Style/AlignHash 997 Style/SpaceAfterComma 860 Style/SpaceAroundEqualsInParameterDefault 310 Style/EmptyLines 294 Style/IndentationConsistency 267 Style/TrailingWhitespace 238 Style/ExtraSpacing 212 Style/SpaceBeforeBlockBraces 166 Style/MultilineOperationIndentation 144 Style/TrailingBlankLines 120 Style/EmptyLineBetweenDefs 101 Style/IndentationWidth 82 Style/SpaceAroundBlockParameters 40 Style/EmptyLinesAroundMethodBody 29 Style/EmptyLinesAroundAccessModifier 1 Style/RescueEnsureAlignment
* Copyright year update for 2016 and massive cleanup.Noah Kantrowitz2016-02-021-1/+1
| | | Generated via git ls-files | xargs perl -pi -e "s/[Cc]opyright (?:\([Cc]\) )?((?\!$(date +%Y))\\d{4})(-\\d{4})?([, ][ \d]+)*(,|(?= ))/Copyright \\1-$(date +%Y),/g"
* Use double quotes by defaultThom May2016-01-141-3/+3
| | | | | | | This is an entirely mechanically generated (chefstyle -a) change, to go along with chef/chefstyle#5 . We should pick something and use it consistently, and my opinion is that double quotes are the appropriate thing.
* Rename log.deprecation to log_deprecationJohn Keiser2015-09-011-2/+2
|
* Pass deprecations through formatter instead of logsJohn Keiser2015-09-011-2/+2
|
* Code review commentsJohn Keiser2015-06-301-1/+0
|
* Optimize logic on class initialize so it doesn't fall into theJohn Keiser2015-06-301-17/+14
| | | | | | "look at all classes to see if they provide the DSL" else clause when you're just setting resource_name (which happens on every class). Perf fix for tests.
* Fix issue where blocks were not considered in priority mappingjdm/3593Jay Mundrawala2015-06-251-1/+1
| | | | This should solve #3593
* Sort identical "provides" alphabetically (for backcompat)John Keiser2015-06-181-38/+63
| | | | - Warn when multiple providers try to provide the same thing
* Make resource_for_short_name look up the canonical resourcejk/automatic-automatic-nameJohn Keiser2015-06-081-4/+18
|
* Make real exceptions, remove stray canonical argumentJohn Keiser2015-06-081-5/+3
|
* Make sure resource_name :x only removes automatic provides from that classJohn Keiser2015-06-081-2/+2
|