Merge "Fix ovs status command"

This commit is contained in:
Jenkins 2016-02-23 12:20:53 +00:00 committed by Gerrit Code Review
commit 3ebeb07188
2 changed files with 2 additions and 3 deletions

View File

@ -52,7 +52,7 @@ class vswitch::ovs(
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
}
default: {
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep "is running"'
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi'
}
}
service { 'openvswitch':
@ -60,7 +60,6 @@ class vswitch::ovs(
enable => true,
name => $::vswitch::params::ovs_service_name,
hasstatus => false, # the supplied command returns true even if it's not running
# Not perfect - should spot if either service is not running - but it'll do
status => $ovs_status,
}

View File

@ -21,7 +21,7 @@ describe 'vswitch::ovs' do
:ovs_service_name => 'openvswitch-switch',
:provider => 'ovs',
:service_hasstatus => false,
:service_status => '/etc/init.d/openvswitch-switch status | fgrep "is running"',
:service_status => '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi',
}
end