sous-chefs / consul

Development repository for the consul cookbook
https://supermarket.chef.io/cookbooks/consul
Apache License 2.0
192 stars 244 forks source link

Fix wrong number of arguments when calling action service on Windows platform #603

Closed tgraskemper closed 2 years ago

tgraskemper commented 2 years ago

Description

Fixes enabling consul service on Windows platform. In 4.8.0 only 2 arguments were required, and in 5.0.0, this was updated to allow for a binary path to be passed, but the Windows service doesn't use this and only passes 2 arguments.

I opted for moving the optional argument to the end of the method args instead of passing a bogus value through the Windows service command call, but will change it if desired.

     ================================================================================
     Error executing action `enable` on resource 'consul_service[consul]'
     ================================================================================

     ArgumentError
     -------------
     wrong number of arguments (given 2, expected 3)

     Cookbook Trace: (most recent call first)
     ----------------------------------------
     C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/consul/libraries/helpers.rb:47:in `command'
     C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/consul/resources/service_windows.rb:38:in `block (2 levels) in class_from_file'
     C:/Users/ADMINI~1/AppData/Local/Temp/kitchen/cache/cookbooks/consul/resources/service_windows.rb:36:in `block in class_from_file'

     Resource Declaration:

Issues Resolved

N/A

Check List

kitchen-porter commented 2 years ago

Released as: 5.3.0