sensu / sensu-go-chef

Chef Library Cookbook for Sensu Go
https://sensu.io
MIT License
11 stars 22 forks source link

Use a guard and not .error? method for sensu_ctl #74

Open webframp opened 4 years ago

webframp commented 4 years ago

I don't remember the reason for trying to use .error? to check the output of the shell exec. What matters though is that the configure is run once when needed and not every time once it's already configured.

This change switches to using a guard and a method to compare the configured backend url.

The shortcoming of this approach is that as the resource is currently written it supports a username and password property, however we do not have an implementation that can safely handle reconfiguring these values so they will only work the first time the resource is used.

Fixes #63


Pull Request Checklist

Is this in reference to an existing issue?

General

New Features

Purpose

Known Compatibility Issues

webframp commented 4 years ago

@majormoses just a start here to experiment with an alternate approach

webframp commented 4 years ago

This one still needs work and isn’t ready to be included for #80 yet