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,8 +48,15 @@ class vswitch::ovs(
|
||||
}
|
||||
|
||||
case $::operatingsystem {
|
||||
'ubuntu': {
|
||||
$ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"'
|
||||
'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'
|
||||
|
@ -107,8 +107,8 @@ describe 'vswitch::ovs' do
|
||||
let :params do default_params end
|
||||
|
||||
let :facts do
|
||||
{:osfamily => 'Redhat',
|
||||
:ovs_version => '1.4.2',
|
||||
{:osfamily => 'Redhat',
|
||||
:ovs_version => '1.4.2',
|
||||
}
|
||||
end
|
||||
|
||||
@ -126,8 +126,8 @@ describe 'vswitch::ovs' do
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{:osfamily => 'Redhat',
|
||||
:ovs_version => '1.4.2',
|
||||
{:osfamily => 'Redhat',
|
||||
:ovs_version => '1.4.2',
|
||||
}
|
||||
end
|
||||
let :platform_params do redhat_platform_params end
|
||||
@ -174,9 +174,10 @@ describe 'vswitch::ovs' do
|
||||
let :params do default_params end
|
||||
|
||||
let :facts do
|
||||
{:osfamily => 'Debian',
|
||||
:operatingsystem => 'ubuntu',
|
||||
:ovs_version => '1.4.2',
|
||||
{:osfamily => 'Debian',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:operatingsystemmajrelease => '14',
|
||||
:ovs_version => '1.4.2',
|
||||
}
|
||||
end
|
||||
let :platform_params do ubuntu_platform_params end
|
||||
@ -193,9 +194,10 @@ describe 'vswitch::ovs' do
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{:osfamily => 'Debian',
|
||||
:operatingsystem => 'ubuntu',
|
||||
:ovs_version => '1.4.2',
|
||||
{:osfamily => 'Debian',
|
||||
:operatingsystem => 'Ubuntu',
|
||||
:operatingsystemmajrelease => '14',
|
||||
:ovs_version => '1.4.2',
|
||||
}
|
||||
end
|
||||
let :platform_params do ubuntu_platform_params end
|
||||
|
Loading…
Reference in New Issue
Block a user