From cdb1dbfe8b4af4a6be38194b6e2e4c3d77be5be1 Mon Sep 17 00:00:00 2001 From: Peter Papucciu Date: Tue, 2 Jul 2024 07:11:41 -0700 Subject: [PATCH] adding usage of DNF in Arista 4.30 and higher Differential Revision: D59270448 fbshipit-source-id: 4ae81e326262083fded5f97fa888c50d4e0d597b --- itchef/cookbooks/fb_helpers/README.md | 4 ++-- itchef/cookbooks/fb_helpers/libraries/node_methods.rb | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/itchef/cookbooks/fb_helpers/README.md b/itchef/cookbooks/fb_helpers/README.md index 54075f5c..a9bd973e 100644 --- a/itchef/cookbooks/fb_helpers/README.md +++ b/itchef/cookbooks/fb_helpers/README.md @@ -243,8 +243,8 @@ 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.aristaeos_4_30_or_newer?` + Is network switch running Arista EOS and OS version is 4.30 or newer * `node.embedded?` Is embedded Linux, implies 'node.aristaeos?'. These devices likely have diff --git a/itchef/cookbooks/fb_helpers/libraries/node_methods.rb b/itchef/cookbooks/fb_helpers/libraries/node_methods.rb index 411f9fdc..edddbac5 100644 --- a/itchef/cookbooks/fb_helpers/libraries/node_methods.rb +++ b/itchef/cookbooks/fb_helpers/libraries/node_methods.rb @@ -540,8 +540,8 @@ 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') + def aristaeos_4_30_or_newer? + self.aristaeos? && self._self_version >= self._canonical_version('4.30') end def embedded? @@ -1038,7 +1038,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.aristaeos_4_31_or_newer? + self.oracle9? || self.aristaeos_4_30_or_newer? # returns epoch.version v = Chef::Provider::Package::Dnf::PythonHelper.instance. package_query(:whatinstalled, name).version