From dfb1ef817ef85fdceb15e641cd2f986b0f25d84d Mon Sep 17 00:00:00 2001 From: Sonu Saha Date: Thu, 17 Mar 2022 11:11:41 +0530 Subject: [PATCH] CFINSPEC-82: Remove ppa resource deprecation for backward compatibility Signed-off-by: Sonu Saha --- etc/deprecations.json | 5 ----- lib/inspec/resources/apt.rb | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/etc/deprecations.json b/etc/deprecations.json index d0eb84cac..6d61f13f6 100644 --- a/etc/deprecations.json +++ b/etc/deprecations.json @@ -83,11 +83,6 @@ "suffix": "This resource was removed in InSpec 4.0.", "comment": "Needed for ServerSpec compatibility" }, - "resource_ppa": { - "action": "exit", - "suffix": "This resource was removed in InSpec 4.0.", - "comment": "Needed for ServerSpec compatibility" - }, "resource_script": { "action": "exit", "suffix": "This resource will be removed in InSpec 4.0" diff --git a/lib/inspec/resources/apt.rb b/lib/inspec/resources/apt.rb index acc3996cb..1abb9151c 100644 --- a/lib/inspec/resources/apt.rb +++ b/lib/inspec/resources/apt.rb @@ -135,19 +135,25 @@ module Inspec::Resources class PpaRepository < AptRepository name "ppa" + desc "Use the ppa InSpec audit resource to verify PPA repositories on the Debian-based linux platforms." + example <<~EXAMPLE + describe ppa('ubuntu-wine/ppa') do + it { should exist } + it { should be_enabled } + end + + describe ppa('ppa:ubuntu-wine/ppa') do + it { should exist } + it { should be_enabled } + end + EXAMPLE def exists? - deprecated super() end def enabled? - deprecated super() end - - def deprecated - Inspec.deprecate(:resource_ppa, "The `ppa` resource is deprecated. Please use `apt`") - end end end