Fix ovs status command
Make sure the status command returns failure if either the ovsdb-server or ovs-vswitchd are stopped. Closes-Bug: 1453211 Change-Id: I372e3f387deb2930d10c209afa3773c7ba3877e3
This commit is contained in:
parent
989e6a96d5
commit
b27b55b42a
@ -52,7 +52,7 @@ class vswitch::ovs(
|
|||||||
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
|
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
|
||||||
}
|
}
|
||||||
default: {
|
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':
|
service { 'openvswitch':
|
||||||
@ -60,7 +60,6 @@ class vswitch::ovs(
|
|||||||
enable => true,
|
enable => true,
|
||||||
name => $::vswitch::params::ovs_service_name,
|
name => $::vswitch::params::ovs_service_name,
|
||||||
hasstatus => false, # the supplied command returns true even if it's not running
|
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,
|
status => $ovs_status,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ describe 'vswitch::ovs' do
|
|||||||
:ovs_service_name => 'openvswitch-switch',
|
:ovs_service_name => 'openvswitch-switch',
|
||||||
:provider => 'ovs',
|
:provider => 'ovs',
|
||||||
:service_hasstatus => false,
|
: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
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user