From 39cbeeb9d29a2c3eb0b781d4cd65d61b272c5341 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Tue, 8 Oct 2013 10:50:30 -0700 Subject: [PATCH] This work flips from onlyif to unless (mistakenly looked at the wrong return code). --- manifests/ppa.pp | 2 +- spec/defines/ppa_spec.rb | 6 +++--- spec/system/basic_spec.rb | 12 ------------ 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/manifests/ppa.pp b/manifests/ppa.pp index e6954af..7cb88c8 100644 --- a/manifests/ppa.pp +++ b/manifests/ppa.pp @@ -42,7 +42,7 @@ define apt::ppa( exec { "add-apt-repository-${name}": environment => $proxy_env, command => "/usr/bin/add-apt-repository ${options} ${name}", - onlyif => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}", + unless => "/usr/bin/test -s ${sources_list_d}/${sources_list_d_filename}", logoutput => 'on_failure', notify => Exec['apt_update'], require => [ diff --git a/spec/defines/ppa_spec.rb b/spec/defines/ppa_spec.rb index 853fdb6..5b59f57 100644 --- a/spec/defines/ppa_spec.rb +++ b/spec/defines/ppa_spec.rb @@ -45,7 +45,7 @@ describe 'apt::ppa', :type => :define do it { should contain_exec("add-apt-repository-#{t}").with( 'command' => "/usr/bin/add-apt-repository #{options} #{t}", - 'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", + 'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", 'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"], 'notify' => "Exec[apt_update]" ) @@ -74,7 +74,7 @@ describe 'apt::ppa', :type => :define do it { should contain_exec("add-apt-repository-#{title}").with( 'environment' => [], 'command' => "/usr/bin/add-apt-repository #{options} #{title}", - 'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", + 'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", 'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"], 'notify' => "Exec[apt_update]" ) @@ -100,7 +100,7 @@ describe 'apt::ppa', :type => :define do "https_proxy=http://user:pass@proxy:8080", ], 'command' => "/usr/bin/add-apt-repository #{options} #{title}", - 'onlyif' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", + 'unless' => "/usr/bin/test -s /etc/apt/sources.list.d/#{filename}", 'require' => ["File[/etc/apt/sources.list.d]", "Package[#{package}]"], 'notify' => "Exec[apt_update]" ) diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb index a87f908..3008356 100644 --- a/spec/system/basic_spec.rb +++ b/spec/system/basic_spec.rb @@ -8,15 +8,3 @@ describe 'basic tests:' do its(:exit_code) { should be_zero } end end - -describe 'disable selinux:' do - context puppet_apply ' - exec { "setenforce 0": - path => "/bin:/sbin:/usr/bin:/usr/sbin", - onlyif => "which setenforce && getenforce | grep Enforcing", - } - ' do - its(:stderr) { should be_empty } - its(:exit_code) { should_not == 1 } - end -end -- 2.45.2