From 27e01d76c82e4c64953278399644b6f2cf6417bf Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Fri, 10 Aug 2018 16:20:02 -0700 Subject: review fixes Signed-off-by: Lamont Granquist --- .travis.yml | 2 ++ kitchen-tests/cookbooks/rspec/metadata.rb | 2 +- kitchen-tests/kitchen.travis.yml | 2 +- lib/chef/provider/mount/mount.rb | 5 ++++- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 50229f7537..d6c6cd0f04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -321,6 +321,8 @@ matrix: - cat /tmp/out.txt - sudo cat /var/log/squid3/cache.log - sudo cat /var/log/squid3/access.log + # Use test-kitchen to launch a centos docker container to run the full rspec tests against. This catches + # errors in travis, before PRs are merged, hopefully before they become errors in jenkins. - rvm: 2.4.4 services: docker sudo: required diff --git a/kitchen-tests/cookbooks/rspec/metadata.rb b/kitchen-tests/cookbooks/rspec/metadata.rb index f0b5bfba75..56fb816ce4 100644 --- a/kitchen-tests/cookbooks/rspec/metadata.rb +++ b/kitchen-tests/cookbooks/rspec/metadata.rb @@ -1,6 +1,6 @@ name "rspec" license "Apache-2.0" -description "Runs nothing" +description "Utility cookbook for rspec testing" version "1.0.0" chef_version ">= 14" diff --git a/kitchen-tests/kitchen.travis.yml b/kitchen-tests/kitchen.travis.yml index 9efbf243ca..cef2b1b98a 100644 --- a/kitchen-tests/kitchen.travis.yml +++ b/kitchen-tests/kitchen.travis.yml @@ -69,7 +69,7 @@ platforms: image: dokken/centos-7 pid_one_command: /usr/lib/systemd/systemd intermediate_instructions: - - RUN yum -y install cronie util-linux e2fsprogs + - RUN yum -y install e2fsprogs - RUN egrep -v '::1' /etc/hosts > /etc/hosts.new - RUN cp /etc/hosts.new /etc/hosts - RUN sed -i -e "s/Defaults.*requiretty.*/Defaults !requiretty/g" /etc/sudoers diff --git a/lib/chef/provider/mount/mount.rb b/lib/chef/provider/mount/mount.rb index 3006b6af07..ad425aead8 100644 --- a/lib/chef/provider/mount/mount.rb +++ b/lib/chef/provider/mount/mount.rb @@ -53,7 +53,10 @@ class Chef def enabled? # Check to see if there is a entry in /etc/fstab. Last entry for a volume wins. enabled = false - return unless ::File.exist?("/etc/fstab") + if ::File.exist?("/etc/fstab") + logger.debug "/etc/fstab not found, treating mount as not-enabled" + return + end ::File.foreach("/etc/fstab") do |line| case line when /^[#\s]/ -- cgit v1.2.1