integ/config/puppet-4.8.2/centos/patches/1002-Set-hasstatus-to-false-by-default.patch
Scott Little bab9bb6b69 Internal restructuring of stx-integ
Create new directories:
   ceph
   config
   config-files
   filesystem
   kernel
   kernel/kernel-modules
   ldap
   logging
   strorage-drivers
   tools
   utilities
   virt

Retire directories:
   connectivity
   core
   devtools
   support
   extended

Delete two packages:
   tgt
   irqbalance

Relocated packages:
   base/
      dhcp
      initscripts
      libevent
      lighttpd
      linuxptp
      memcached
      net-snmp
      novnc
      ntp
      openssh
      pam
      procps
      sanlock
      shadow
      sudo
      systemd
      util-linux
      vim
      watchdog

   ceph/
      python-cephclient

   config/
      facter
      puppet-4.8.2
      puppet-modules

   filesystem/
      e2fsprogs
      nfs-utils
      nfscheck

   kernel/
      kernel-std
      kernel-rt

   kernel/kernel-modules/
      mlnx-ofa_kernel

   ldap/
      nss-pam-ldapd
      openldap

   logging/
      syslog-ng
      logrotate

   networking/
      lldpd
      iproute
      mellanox
      python-ryu
      mlx4-config

   python/
      python-2.7.5
      python-django
      python-gunicorn
      python-setuptools
      python-smartpm
      python-voluptuous

   security/
      shim-signed
      shim-unsigned
      tboot

   strorage-drivers/
      python-3parclient
      python-lefthandclient

   virt/
      cloud-init
      libvirt
      libvirt-python
      qemu

   tools/
      storage-topology
      vm-topology

   utilities/
      tis-extensions
      namespace-utils
      nova-utils
      update-motd

Change-Id: I37ade764d873c701b35eac5881eb40412ba64a86
Story: 2002801
Task: 22687
Signed-off-by: Scott Little <scott.little@windriver.com>
2018-08-01 10:06:31 -04:00

50 lines
1.8 KiB
Diff

From a0ce82562d75c62fbe7258d0ed4e3ac6d0248ed4 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
Date: Fri, 30 Dec 2016 10:59:44 -0500
Subject: [PATCH] Set hasstatus to false by default
Many of the WR init scripts do not have proper status functions,
so set "hasstatus" to false by default.
---
lib/puppet/provider/service/init.rb | 9 ++++++++-
lib/puppet/type/service.rb | 3 ++-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/lib/puppet/provider/service/init.rb b/lib/puppet/provider/service/init.rb
index 9f2d030..69940ca 100644
--- a/lib/puppet/provider/service/init.rb
+++ b/lib/puppet/provider/service/init.rb
@@ -81,7 +81,14 @@ Puppet::Type.type(:service).provide :init, :parent => :base do
next if exclude.include? name
next if not FileTest.executable?(fullpath)
next if not is_init?(fullpath)
- instances << new(:name => name, :path => path, :hasstatus => true)
+
+ # Try to determine whether the init script has "status" support via grep
+ grepcmd = "grep -q '\\<status)' #{fullpath} 2>/dev/null && echo true || echo false"
+ if Puppet::Util::Execution.execute(grepcmd) =~ /true/
+ instances << new(:name => name, :path => path, :hasstatus => true)
+ else
+ instances << new(:name => name, :path => path, :hasstatus => false)
+ end
end
end
instances
diff --git a/lib/puppet/type/service.rb b/lib/puppet/type/service.rb
index dc54f1d..2bab7fc 100644
--- a/lib/puppet/type/service.rb
+++ b/lib/puppet/type/service.rb
@@ -134,7 +134,8 @@ module Puppet
newvalues(:true, :false)
- defaultto :true
+ # WRS: Change hasstatus default to false
+ defaultto :false
end
newparam(:name) do
desc <<-EOT
--
1.8.3.1