]> review.fuel-infra Code Review - puppet-modules/puppetlabs-apt.git/commitdiff
Merge branch 'master' into remove_ppa_source
authordavid22swan <david.swan@puppet.com>
Thu, 23 Aug 2018 15:02:02 +0000 (16:02 +0100)
committerGitHub <noreply@github.com>
Thu, 23 Aug 2018 15:02:02 +0000 (16:02 +0100)
1  2 
manifests/ppa.pp
spec/defines/ppa_spec.rb

index 4ee08ba3c49526edd332f7e82eb339b687f31132,740d59643c02c9362b6449e1f0c0885776970b07..99af21937529d983cfa4e590ef8e48c7bd3285a9
@@@ -46,8 -57,8 +57,8 @@@ define apt::ppa
  
      exec { "add-apt-repository-${name}":
        environment => $_proxy_env,
 -      command     => "/usr/bin/add-apt-repository ${options} ${name}",
 +      command     => "/usr/bin/add-apt-repository ${options} ${name} || (rm ${::apt::sources_list_d}/${sources_list_d_filename} && false)",
-       unless      => "/usr/bin/test -f ${::apt::sources_list_d}/${sources_list_d_filename}",
+       unless      => "/usr/bin/test -f ${::apt::sources_list_d}/${sources_list_d_filename} && /usr/bin/test -f ${::apt::trusted_gpg_d}/${trusted_gpg_d_filename}",
        user        => 'root',
        logoutput   => 'on_failure',
        notify      => Class['apt::update'],
index 984c3e872ca6ccf5b34b7d42b1fb5020b2205b56,4c4dddb171d7c3479c5a8aa21a279ca12060adf2..fa893b6997272429aac97883c1cd48328edbd368
@@@ -22,8 -22,8 +22,8 @@@ describe 'apt::ppa' d
      it { is_expected.not_to contain_package('python-software-properties') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow+type').that_notifies('Class[Apt::Update]').with(environment: [],
 -                                                                                                                                      command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type', # rubocop:disable Metrics/LineLength
 +                                                                                                                                      command: '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow+type || (rm /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                       unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                       unless: '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow_type-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow_type.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                        user: 'root',
                                                                                                                                        logoutput: 'on_failure')
      }
@@@ -46,8 -46,8 +46,8 @@@
  
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
 -                                                                                                              command: '/usr/bin/add-apt-repository -y ppa:user/foo',
 +                                                                                                              command: '/usr/bin/add-apt-repository -y ppa:user/foo || (rm /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list',
+                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-ubuntu-foo-wily.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user_ubuntu_foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                user: 'root',
                                                                                                                logoutput: 'on_failure')
      }
@@@ -80,8 -80,8 +80,8 @@@
      it { is_expected.to contain_package('software-properties-common') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [],
 -                                                                                                                                 'command'     => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow', # rubocop:disable Metrics/LineLength
 +                                                                                                                                 'command'     => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                  'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                  'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                   'user'        => 'root',
                                                                                                                                   'logoutput'   => 'on_failure')
      }
      it { is_expected.not_to contain_package('python-software-properties') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:needs/such.substitution/wow').that_notifies('Class[Apt::Update]').with('environment' => [],
 -                                                                                                                                 'command'     => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow', # rubocop:disable Metrics/LineLength
 +                                                                                                                                 'command'     => '/usr/bin/add-apt-repository -y ppa:needs/such.substitution/wow || (rm /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                                                  'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list', # rubocop:disable Metrics/LineLength
+                                                                                                                                  'unless'      => '/usr/bin/test -f /etc/apt/sources.list.d/needs-such_substitution-wow-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/needs-such_substitution-wow.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                                   'user'        => 'root',
                                                                                                                                   'logoutput'   => 'on_failure')
      }
      it { is_expected.to contain_package('software-properties-common') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: [],
 -                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo',
 +                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                user: 'root',
                                                                                                                logoutput: 'on_failure')
      }
      it { is_expected.to contain_package('software-properties-common') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8080'],
 -                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo',
 +                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                user: 'root',
                                                                                                                logoutput: 'on_failure')
      }
      it { is_expected.to contain_package('software-properties-common') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180'],
 -                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo',
 +                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                user: 'root',
                                                                                                                logoutput: 'on_failure')
      }
      it { is_expected.to contain_package('software-properties-common') }
      it {
        is_expected.to contain_exec('add-apt-repository-ppa:user/foo').that_notifies('Class[Apt::Update]').with(environment: ['http_proxy=http://localhost:8180', 'https_proxy=https://localhost:8180'],
 -                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo',
 +                                                                                                              command: '/usr/bin/add-apt-repository  ppa:user/foo || (rm /etc/apt/sources.list.d/user-foo-trusty.list && false)', # rubocop:disable Metrics/LineLength
-                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list',
+                                                                                                               unless: '/usr/bin/test -f /etc/apt/sources.list.d/user-foo-trusty.list && /usr/bin/test -f /etc/apt/trusted.gpg.d/user-foo.gpg', # rubocop:disable Metrics/LineLength
                                                                                                                user: 'root',
                                                                                                                logoutput: 'on_failure')
      }