From 1f63cee543d725e4a7d6de7f2f3eda235c85b564 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 25 Apr 2021 21:47:44 +0900 Subject: [PATCH] Remove old workaround to check service status in Ubuntu Change-Id: Ie7e05985ac06c5536490d48de109d8de7b7c5722 --- manifests/params.pp | 11 ++--------- spec/classes/vswitch_ovs_spec.rb | 8 +------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 4d655573..7c310f67 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -25,15 +25,8 @@ class vswitch::params { $provider = 'ovs' case $::operatingsystem { '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_service_hasstatus = false + $ovs_service_hasstatus = true + $ovs_status = undef } 'debian': { if ($::lsbdistcodename == 'wheezy') { diff --git a/spec/classes/vswitch_ovs_spec.rb b/spec/classes/vswitch_ovs_spec.rb index d5805797..d2aec193 100644 --- a/spec/classes/vswitch_ovs_spec.rb +++ b/spec/classes/vswitch_ovs_spec.rb @@ -317,18 +317,12 @@ describe 'vswitch::ovs' do :service_hasstatus => true, } elsif facts[:operatingsystem] == 'Ubuntu' - if Puppet::Util::Package.versioncmp(facts[:operatingsystemmajrelease], '16') >= 0 - status_cmd = '/etc/init.d/openvswitch-switch status | fgrep -q "not running"; if [ $? -eq 0 ]; then exit 1; else exit 0; fi' - else - status_cmd = '/sbin/status openvswitch-switch | fgrep "start/running"' - end { :ovs_package_name => 'openvswitch-switch', :ovs_dkms_package_name => 'openvswitch-datapath-dkms', :ovs_service_name => 'openvswitch-switch', :provider => 'ovs', - :service_hasstatus => false, - :service_status => status_cmd + :service_hasstatus => true, } end when 'RedHat'