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:
parent
a14015f489
commit
83ad1e5aa5
@ -48,9 +48,16 @@ class vswitch::ovs(
|
|||||||
}
|
}
|
||||||
|
|
||||||
case $::operatingsystem {
|
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"'
|
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi'
|
$ovs_status = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi'
|
||||||
}
|
}
|
||||||
|
@ -175,7 +175,8 @@ describe 'vswitch::ovs' do
|
|||||||
|
|
||||||
let :facts do
|
let :facts do
|
||||||
{:osfamily => 'Debian',
|
{:osfamily => 'Debian',
|
||||||
:operatingsystem => 'ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
|
:operatingsystemmajrelease => '14',
|
||||||
:ovs_version => '1.4.2',
|
:ovs_version => '1.4.2',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -194,7 +195,8 @@ describe 'vswitch::ovs' do
|
|||||||
|
|
||||||
let :facts do
|
let :facts do
|
||||||
{:osfamily => 'Debian',
|
{:osfamily => 'Debian',
|
||||||
:operatingsystem => 'ubuntu',
|
:operatingsystem => 'Ubuntu',
|
||||||
|
:operatingsystemmajrelease => '14',
|
||||||
:ovs_version => '1.4.2',
|
:ovs_version => '1.4.2',
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user