org-binbab / cookbook-service_factory

Chef Cookbook https://supermarket.getchef.com/cookbooks/service_factory
Apache License 2.0
1 stars 6 forks source link

Getting ArgumentError when trying to use `service_factory` LWRP #3

Open apetresc opened 9 years ago

apetresc commented 9 years ago

The section:

service_factory "repairbot" do
  service_desc "Cassandra RepairBot"
  exec "/opt/repairbot/virtualenv/bin/python /opt/repairbot/repairbot.py"
  run_user "root"
  run_group "root"
  action :create
end

which gets expanded to:

    service_factory("repairbot") do
      action :create
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      declared_type :service_factory
      cookbook_name :rubikloud
      recipe_name "setup_cassandra"
      service_desc "Cassandra RepairBot"
      exec "/opt/repairbot/virtualenv/bin/python /opt/repairbot/repairbot.py"
      run_user "root"
      run_group "root"
    end

fails every single time with the error:

Recipe: rubikloud::setup_cassandra
  * service_factory[repairbot] action create

    ================================================================================
    Error executing action `create` on resource 'service_factory[repairbot]'
    ================================================================================

    ArgumentError
    -------------
    wrong number of arguments (2 for 0)

    Resource Declaration:
    ---------------------
    # In /home/apetresc/chef-solo/cookbooks-2/rubikloud/recipes/setup_cassandra.rb

     62: service_factory "repairbot" do
     63:   service_desc "Cassandra RepairBot"
     64:   exec "/opt/repairbot/virtualenv/bin/python /opt/repairbot/repairbot.py"
     65:   run_user "root"
     66:   run_group "root"
     67:   action :create
     68: end

I'm quite sure I'm using the attributes correctly, so I have to assume this is some sort of incompatibility with Chef 12?

nilesh1013 commented 9 years ago

+1 getting same error.... ArgumentError: wrong number of arguments

alejandrod commented 9 years ago

This is because of an error with Chef12. Please try my fixes until the PR is approved. https://github.com/org-binbab/cookbook-service_factory/pull/4 https://github.com/alejandrod/cookbook-service_factory

babelop commented 9 years ago

Apologies with regards to the delay in this bug report. Thank you @alejandrod for the pull request and lending a hand. An update is forthcoming.

benmcrae commented 9 years ago

Any update on when the pull request will be accepted?

babelop commented 8 years ago

I'm sorry this issue has lagged so far behind. Changes to our infrastructure have left our own Chef usage a bit in the stone-age. I'm happy to merge this pull request, but I'd feel more confortable doing so with the knowledge that it's still desired and verified from multiple sources. So anyone still interested (and especially who have tested this patch). Please comment.

alejandrod commented 8 years ago

I've been using this on many places and different clients. So, I can only say it works for me. @benmcrae??