Fix TSO lock file check when running the script
Correctly check if TSO is already started by testing the PID file presence.
This commit is contained in:
		| @@ -166,7 +166,7 @@ Host * | ||||
|     } | ||||
|     ensure_resource ('exec','start-tso-script', { | ||||
|       'command' => '/etc/init.d/disable-tso start', | ||||
|       'unless'  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|       'unless'  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|       'onlyif'  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|     }) | ||||
|   } | ||||
|   | ||||
| @@ -65,7 +65,7 @@ class cloud::network::l3( | ||||
|     } | ||||
|     ensure_resource ('exec','start-tso-script', { | ||||
|       'command' => '/etc/init.d/disable-tso start', | ||||
|       'unless'  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|       'unless'  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|       'onlyif'  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|     }) | ||||
|   } | ||||
|   | ||||
| @@ -280,7 +280,7 @@ describe 'cloud::compute::hypervisor' do | ||||
|       it 'start TSO script' do | ||||
|         should contain_exec('start-tso-script').with( | ||||
|           :command => '/etc/init.d/disable-tso start', | ||||
|           :unless  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|           :unless  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|           :onlyif  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|         ) | ||||
|       end | ||||
| @@ -302,7 +302,7 @@ describe 'cloud::compute::hypervisor' do | ||||
|       it 'start TSO script' do | ||||
|         should contain_exec('start-tso-script').with( | ||||
|           :command => '/etc/init.d/disable-tso start', | ||||
|           :unless  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|           :unless  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|           :onlyif  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|         ) | ||||
|       end | ||||
|   | ||||
| @@ -105,7 +105,7 @@ describe 'cloud::network::l3' do | ||||
|       it 'start TSO script' do | ||||
|         should contain_exec('start-tso-script').with( | ||||
|           :command => '/etc/init.d/disable-tso start', | ||||
|           :unless  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|           :unless  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|           :onlyif  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|         ) | ||||
|       end | ||||
| @@ -126,7 +126,7 @@ describe 'cloud::network::l3' do | ||||
|       it 'start TSO script' do | ||||
|         should contain_exec('start-tso-script').with( | ||||
|           :command => '/etc/init.d/disable-tso start', | ||||
|           :unless  => '/usr/bin/test -f /tmp/disable-tso-lock', | ||||
|           :unless  => '/usr/bin/test -f /var/run/disable-tso.pid', | ||||
|           :onlyif  => '/usr/bin/test -f /etc/init.d/disable-tso' | ||||
|         ) | ||||
|       end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Emilien Macchi
					Emilien Macchi