Unverified Commit 1cc6d508 authored by Kierran McPherson's avatar Kierran McPherson Committed by GitHub
Browse files

Merge pull request #156 from RoboticCheese/roboticcheese/systemd-fixes

Fix collector provider installation detection for 19.216-33 on Systemd platforms
parents d8fb1ef9 af67cab7
......@@ -11,6 +11,7 @@ platforms:
- name: debian-8.7
- name: ubuntu-14.04
- name: ubuntu-16.04
- name: ubuntu-18.04
- name: windows-2008r2
driver:
box: opentable/win-2008r2-standard-amd64-nocm
......@@ -52,6 +53,7 @@ suites:
- debian-8.7
- ubuntu-14.04
- ubuntu-16.04
- ubuntu-18.04
- name: default-resource
run_list:
- recipe[default-resource]
......
......@@ -4,6 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG (now) follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
## [Unreleased]
### Changed
- delete legacy ChefSpec matchers (@RoboticCheese)
### Fixed
- fix collector provider installation detection for 19.216-33 on Systemd platforms (@RoboticCheese)
## [1.3.1] - 2018-06-22
### Added
......
# frozen_string_literal: true
if defined?(ChefSpec)
#####################
# sumologic_collector
#####################
ChefSpec.define_matcher :sumologic_collector
def install_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :install, resource_name)
end
def configure_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :configure, resource_name)
end
def install_and_configure_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :install_and_configure, resource_name)
end
def start_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :start, resource_name)
end
def stop_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :stop, resource_name)
end
def restart_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :restart, resource_name)
end
def enable_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :enable, resource_name)
end
def disable_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :disable, resource_name)
end
def remove_sumologic_collector(resource_name)
ChefSpec::Matchers::ResourceMatcher.new(:sumologic_collector, :remove, resource_name)
end
end
......@@ -110,12 +110,9 @@ end
private
def installed?
case node['platform_family']
when 'windows'
::Win32::Service.exists? 'sumo-collector'
else
::File.exist? '/etc/init.d/collector'
end
path = ::File.join(new_resource.dir,
"uninstall#{'.exe' if node['platform_family'] == 'windows'}")
::File.exist?(path)
end
def installer_bin
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment