Skip to content

Commit

Permalink
Configure DNF on Arista EOS 4.31+
Browse files Browse the repository at this point in the history
Differential Revision: D54747272

fbshipit-source-id: fb45b067dbd6f408ed50d2921a2738713079bee9
  • Loading branch information
fabianishere authored and facebook-github-bot committed Mar 12, 2024
1 parent a00f578 commit e50ee35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cookbooks/fb_helpers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ your node.
* `node.aristaeos_4_28_or_newer?`
Is network switch running Arista EOS and OS version is 4.28 or newer

* `node.aristaeos_4_31_or_newer?`
Is network switch running Arista EOS and OS version is 4.31 or newer

* `node.embedded?`
Is embedded Linux, implies 'node.aristaeos?'. These devices likely have
minimal packages installed, little space, and/or some non-persistent
Expand Down
6 changes: 5 additions & 1 deletion cookbooks/fb_helpers/libraries/node_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,10 @@ def aristaeos_4_28_or_newer?
self.aristaeos? && self._self_version >= self._canonical_version('4.28')
end

def aristaeos_4_31_or_newer?
self.aristaeos? && self._self_version >= self._canonical_version('4.31')
end

def embedded?
self.aristaeos?
end
Expand Down Expand Up @@ -1026,7 +1030,7 @@ def filesystem_data
# returns the version-release of an rpm installed, or nil if not present
def rpm_version(name)
if (self.centos? && !self.centos7?) || self.fedora? || self.redhat8? || self.oracle8? || self.redhat9? ||
self.oracle9?
self.oracle9? || self.aristaeos_4_31_or_newer?
# returns epoch.version
v = Chef::Provider::Package::Dnf::PythonHelper.instance.
package_query(:whatinstalled, name).version
Expand Down

0 comments on commit e50ee35

Please sign in to comment.