saltstack-formulas / sensu-formula

Salt Stack formula to manage Sensu.
http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
23 stars 78 forks source link

Remove invalid parameter values. #43

Closed snadorp closed 7 years ago

snadorp commented 7 years ago

Proxy and source are not allowed to be None.

ayoub-benali commented 7 years ago

For further details, when gem_source and gem_proxy are not set, None is forwarded to gem command line which returns an error. Example:

2017-07-21 15:50:07,378 [salt.loaded.int.module.cmdmod][INFO    ][24769] Executing command ['/opt/sensu/embedded/bin/gem', 'install', 'mail', '--no-rdoc', '--no-ri', '-p', 'None', '--source', 'None'] in directory '/root'
2017-07-21 15:50:07,783 [salt.loaded.int.module.cmdmod][ERROR   ][24769] Command '['/opt/sensu/embedded/bin/gem', 'install', 'mail', '--no-rdoc', '--no-ri', '-p', 'None', '--source', 'None']' failed with return code: 1
2017-07-21 15:50:07,783 [salt.loaded.int.module.cmdmod][ERROR   ][24769] stderr: ERROR:  While executing gem ... (OptionParser::InvalidArgument)
    invalid argument: -p None
2017-07-21 15:50:07,784 [salt.loaded.int.module.cmdmod][ERROR   ][24769] retcode: 1
2017-07-21 15:50:07,784 [salt.state       ][ERROR   ][24769] An exception occurred in this state: Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/state.py", line 1750, in call
    **cdata['kwargs'])
  File "/usr/lib/python2.7/dist-packages/salt/loader.py", line 1705, in wrapper
    return f(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/states/gem.py", line 108, in installed
    source=source):
  File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 138, in install
    runas=runas)
  File "/usr/lib/python2.7/dist-packages/salt/modules/gem.py", line 66, in _gem
    raise CommandExecutionError(ret['stderr'])
CommandExecutionError: ERROR:  While executing gem ... (OptionParser::InvalidArgument)
    invalid argument: -p None
EvaSDK commented 7 years ago

Duplicate of PR #39, if you are interested in this formula, I would greatly appreciate you checking my other PR, maybe we can get someone with the relevant access to merge them then.

powellchristoph commented 7 years ago

@EvaSDK @snadorp @ayoub-benali Figure out how you would like to combine these two PR's and I can assist getting them merged.

EvaSDK commented 7 years ago

@snadorp everything was merged, could you report if everything works fine for you ?

ayoub-benali commented 7 years ago

The issue is fixed for us and this PR can be closed. Thanks