Add check status command for Ubuntu 16.04

Add case for status command for Ubuntu 16.04 (Xenial), which
doesn't have upstart.

Change-Id: I2c96e114ad642a7666b6039ada9d1fa50ad8bdcd
This commit is contained in:
Denis Egorenko 2016-05-24 16:32:57 +03:00
parent a14015f489
commit 83ad1e5aa5
2 changed files with 21 additions and 12 deletions

View File

@ -48,9 +48,16 @@ class vswitch::ovs(
}
case $::operatingsystem {
'ubuntu': {
'Ubuntu': {
# ubuntu 16.04 doesn't have upstart
# this workaround should be removed when https://bugs.launchpad.net/ubuntu/+source/openvswitch/+bug/1585201
# will be resolved
if versioncmp($::operatingsystemmajrelease, '16') >= 0 {
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi'
} else {
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
}
}
default: {
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi'
}

View File

@ -175,7 +175,8 @@ describe 'vswitch::ovs' do
let :facts do
{:osfamily => 'Debian',
:operatingsystem => 'ubuntu',
:operatingsystem => 'Ubuntu',
:operatingsystemmajrelease => '14',
:ovs_version => '1.4.2',
}
end
@ -194,7 +195,8 @@ describe 'vswitch::ovs' do
let :facts do
{:osfamily => 'Debian',
:operatingsystem => 'ubuntu',
:operatingsystem => 'Ubuntu',
:operatingsystemmajrelease => '14',
:ovs_version => '1.4.2',
}
end