This work flips from onlyif to unless (mistakenly looked at the
authorAshley Penney <ashley.penney@puppetlabs.com>
Tue, 8 Oct 2013 17:50:30 +0000 (10:50 -0700)
committerAshley Penney <ashley.penney@puppetlabs.com>
Tue, 8 Oct 2013 17:50:30 +0000 (10:50 -0700)
wrong return code).

manifests/ppa.pp
spec/defines/ppa_spec.rb
spec/system/basic_spec.rb

index e6954af3b74494187ee4a46392624ec3959d95fe..7cb88c8cd5a32ec8b591e6abb1f7bac03fef68df 100644 (file)
@@ -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      => [
index 853fdb67f06197887bcde17442fe71e5db7a8762..5b59f57776bc389e4f1c4bf7e9ef24ac09ab8e67 100644 (file)
@@ -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]"
           )
index a87f908411f5296adc6b9ecbdaab6aeff68f99da..3008356356649d22042b9cecf1d0989992276de8 100644 (file)
@@ -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