Skip to content

Commit 468f8f2

Browse files
ryantimwilsonfacebook-github-bot
authored andcommitted
Add fedora_[max|min]_version helpers
Summary: fb_helpers currently has similar helpers for ubuntu|debian|centos but not for fedora. Adding it, so we can use it in a follow-up PR Differential Revision: D74013494 fbshipit-source-id: dc16c63f753de7c2f4bab475e7aaee7c34b8dc25
1 parent e86019c commit 468f8f2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cookbooks/fb_helpers/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,14 @@ your node.
110110
* `node.fedora40?`
111111
Is Fedora 40
112112

113+
* `node.fedora_max_version?(v, full=false)`
114+
Is RHEL-compatible with a maximum version number of v
115+
See os_max_version? for details.
116+
117+
* `node.fedora_min_version?(v, full=false)`
118+
Is RHEL-compatible with a minimum version number of v
119+
See os_min_version? for details.
120+
113121
* `node.eln?`
114122
Is Fedora ELN
115123

cookbooks/fb_helpers/libraries/node_methods.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,14 @@ def fedora40?
307307
self.fedora? && self['platform_version'] == '40'
308308
end
309309

310+
def fedora_max_version?(version, full = false)
311+
self.fedora? && self.os_max_version?(version, full)
312+
end
313+
314+
def fedora_min_version?(version, full = false)
315+
self.fedora? && self.os_min_version?(version, full)
316+
end
317+
310318
def eln?
311319
self['platform'] == 'fedora' &&
312320
self['os_release'] &&

0 commit comments

Comments
 (0)