sensu/sensu-puppet — pull request #255 by bodgit (2014-09-30 15:21:09+00:00)
Title: Use the command parameter if it's defined alongside the source parameter

Previously if command and source parameters were both specified, the value of command was in fact ignored. This is not desired when the command might need additional preamble or arguments to function.

Specifically my use case is to install a Ruby-based handler, but due to running CentOS/RHEL 6.x with Ruby 1.8.7 and not wanting to pollute the embedded Ruby installed and used by Sensu I have it working using a Ruby installed as part of the RHEL Software Collections. So my actual command should be:

`env -u GEM_PATH scl enable ruby193 /etc/sensu/handlers/myshinyhandler.rb`

(Annoyingly, I found I need to clear $GEM_PATH otherwise my separate SCL Ruby uses the gems from the embedded Ruby and it still doesn't work)

However when I define my handler like so:

```
::sensu::handler { 'myshinyhandler':
type => pipe,
command => 'env -u GEM_PATH scl enable ruby193 /etc/sensu/handlers/myshinyhandler.rb',
source => 'puppet:///modules/mymodule/myshinyhandler.rb',
}
```

The resulting `myshinyhandler.json` config file just has `/etc/sensu/handlers/myshinyhandler.rb` for the command.

This PR just uses the value of command if it's defined alongside source, otherwise behave as before and set it to the concatenation of the install path and the base filename of the handler.