libraries/sensu_helpers.rb
# We need a helper to determine whether to use rhel 6 or 7
# Due to the change in amazon linux 2 versioning
#
# @param platform_version [String] The platform version, as reported by ohai
We need a helper to determine whether to use rhel 6 or 7
Due to the change in amazon linux 2 versioning
We need a helper to determine whether to use rhel 6 or 7 Due to the change in amazon linux 2 versioning
def amazon_linux_2_rhel_version(platform_version)
        return "6" if /201\d/.match?(platform_version)
        return "7" if platform_version == "2" || platform_version.include?("amzn2")
        raise "Unsupported Linux platform version #{platform_version} - rhel version unknown"
      end
def amazon_linux_2_rhel_version ( platform_version ) return "6" if / 201 \d / . match? ( platform_version ) return "7" if platform_version == "2" || platform_version . include? ( "amzn2" ) raise "Unsupported Linux platform version #{platform_version} - rhel version unknown" end
We need a helper to determine whether to use rhel 6 or 7
Due to the change in amazon linux 2 versioning
We need a helper to determine whether to use rhel 6 or 7 Due to the change in amazon linux 2 versioning
# TODO: once we no longer support chef versions < 14.3.0 we should remove the check for amzon2 and remove this comment
platform_version
The platform version, as reported by ohai
The platform version as reported by ohai