From 11090e13d1fd3c366fc60bc09e5af5ec363c3f2e Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Fri, 7 Mar 2014 10:59:57 +0100 Subject: [PATCH] Fix openvswitch-switch status command on Ubuntu platform When running on Ubuntu, the manifest checks the status of the openvswitch-switch service using the Upstart 'status' command and grep-ing on 'start/running'. Change-Id: Icf17fa2bb6f9f5449673c3737b9ecbb24dbeebb1 Closes-Bug: #1288659 --- manifests/ovs.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/manifests/ovs.pp b/manifests/ovs.pp index a2eaa777..9ce892cc 100644 --- a/manifests/ovs.pp +++ b/manifests/ovs.pp @@ -13,13 +13,21 @@ class vswitch::ovs( if ! defined(Package[$kernelheaders_pkg]) { package { $kernelheaders_pkg: ensure => $package_ensure } } + case $::operatingsystem { + 'ubuntu': { + $ovs_status = '/sbin/status openvswitch-switch | fgrep "start/running"' + } + default: { + $ovs_status = '/etc/init.d/openvswitch-switch status | fgrep "is running"' + } + } service {'openvswitch': ensure => true, enable => true, name => $::vswitch::params::ovs_service_name, 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 => '/etc/init.d/openvswitch-switch status | fgrep "is running"', + status => $ovs_status } exec { 'rebuild-ovsmod': command => '/usr/sbin/dpkg-reconfigure openvswitch-datapath-dkms > /tmp/reconf-log',