Merge pull request #716 from kbarmen/master
authorwillmeek <william.meek@puppet.com>
Mon, 6 Nov 2017 11:29:18 +0000 (11:29 +0000)
committerGitHub <noreply@github.com>
Mon, 6 Nov 2017 11:29:18 +0000 (11:29 +0000)
Do not treat debian stable-updates as security updates

lib/facter/apt_updates.rb
spec/unit/facter/apt_package_security_updates_spec.rb
spec/unit/facter/apt_security_updates_spec.rb

index f0fa3026918073ac2598d351dae9b85460b26064..89bc37e20ba4d497b805e4940252f10c6afdd17e 100644 (file)
@@ -10,7 +10,6 @@ Facter.add('apt_has_updates') do
         package = line.gsub(%r{^Inst\s([^\s]+)\s.*}, '\1').strip
         apt_package_updates[0].push(package)
         security_matches = [
-          %r{ Debian[^\s]+-updates[, ]},
           %r{ Debian-Security:},
           %r{ Ubuntu[^\s]+-security[, ]},
           %r{ gNewSense[^\s]+-security[, ]},
index ff636d3ece26c23ae8f5bdc400e9f654d4d0dd77..b6a713f18697f46a1899da4602be8556aca4d838 100644 (file)
@@ -26,14 +26,16 @@ describe 'apt_package_security_updates fact' do
         "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \
           "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \
           "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \
-          "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n"
+          "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \
+          "Inst curl [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \
+          "Conf curl (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \
       end
 
       it {
         if Facter.version < '2.0.0'
-          is_expected.to eq('tzdata')
+          is_expected.to eq('curl')
         else
-          is_expected.to eq(['tzdata'])
+          is_expected.to eq(['curl'])
         end
       }
     end
index af8951b1ba8a7167f4dbd8b5815c68f97331d5c9..fc93552b2b8f4f2b00f6f84d05ac5b965a53afc5 100644 (file)
@@ -26,7 +26,9 @@ describe 'apt_security_updates fact' do
         "Inst tzdata [2015f-0+deb8u1] (2015g-0+deb8u1 Debian:stable-updates [all])\n" \
           "Conf tzdata (2015g-0+deb8u1 Debian:stable-updates [all])\n" \
           "Inst unhide.rb [13-1.1] (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \
-          "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n"
+          "Conf unhide.rb (22-2~bpo8+1 Debian Backports:jessie-backports [all])\n" \
+          "Inst curl [7.52.1-5] (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64]) []\n" \
+          "Conf curl (7.52.1-5+deb9u2 Debian-Security:9/stable [amd64])\n" \
       end
 
       it { is_expected.to eq(1) }