chef-cookbooks icon indicating copy to clipboard operation
chef-cookbooks copied to clipboard

fb_helpers cleanup

Open jaymzh opened this issue 7 months ago • 0 comments

I went to start adding missing version of all our osXX? version wrappers but then I thought - this isn't sustainable, we should come up with something better. We already have like centos10? but not rhel10? for example. We can do better.

So instead this if a new approach. For each platform we create a new _v method which will work for all versions. This is how it works:

  • Create fedora_v?() which you can pass 39, 40, 41 to, etc.
  • Turn fedoraXX? methods to just call the above, and mark them deprecated

And repeat for all platforms which we had these functions.

This also clears up rhel? vs rhel_family? (which were the same, but not made clear) and redhat?

It also fixes the tests which were setting node.default, but ohai attrs are node.automatic.

And final note: I didn't do windows helpers because their versions don't map directly, so there's no nice way to do it.

Signed-off-by: Phil Dibowitz [email protected]

jaymzh avatar Apr 25 '25 00:04 jaymzh