Giter Site home page Giter Site logo

ridley's Introduction

Berkshelf

Gem Version Matrix Testing

Manage Chef Infra cookbooks and cookbook dependencies

Warning

Berkshelf is effectively deprecated. There is no ongoing maintenance and triage of issues. No active work is being done on bugfixes. The only work being done is to maintain it so that it continues to ship and run in its existing state.

Existing users should strongly consider migrating to Policyfiles and new users should avoid using Berkshelf.

Installation

Berkshelf is now included as part of the Chef Workstation. This is fastest, easiest, and the recommended installation method for getting up and running with Berkshelf.

note: You may need to uninstall the Berkshelf gem especially if you are using a Ruby version manager you may need to uninstall all Berkshelf gems from each Ruby installation.

From Rubygems

If you are a developer or you prefer to install from Rubygems, we've got you covered.

Add Berkshelf to your repository's Gemfile:

gem 'berkshelf'

Or run it as a standalone:

$ gem install berkshelf

Usage

See docs.chef.io for up-to-date usage instructions.

CLI Usage

Berkshelf is intended to be used as a CLI tool. It is not intended to be used as a library. Other ruby code should shell out to the command line tool to use it.

Supported Platforms

Berkshelf is tested and supported on Ruby 2.4 and later.

Configuration

Berkshelf will search in specific locations for a configuration file. In order:

$PWD/.berkshelf/config.json
~/.berkshelf/config.json

You are encouraged to keep project-specific configuration in the $PWD/.berkshelf directory. A default configuration file is generated for you, but you can update the values to suit your needs.

Shell Completion

Plugins

Please see Plugins page for more information.

Getting Help

  • If you have an issue: report it on the issue tracker
  • If you have a question: visit the #chef or #berkshelf channel on irc.freenode.net

Authors

Thank you to all of our Contributors, testers, and users.

If you'd like to contribute, please see our contribution guidelines first.

ridley's People

Contributors

capoferro avatar chrisroberts avatar coderanger avatar ctrlok avatar danielsdeleo avatar diadistis avatar grozen avatar ivey avatar jfoy avatar jkeiser avatar johnae avatar justincampbell avatar kallan357 avatar lamont-granquist avatar miah avatar mpasternacki avatar orthographic-pedant avatar pocke avatar promisedlandt avatar reset avatar samcrang avatar sethvargo avatar spion06 avatar stensonb avatar tas50 avatar thommay avatar timbuchwaldt avatar webcoyote avatar wjessop avatar xamebax avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ridley's Issues

The `.all` method should return an array itself instead of an instance or Array?

According to README, the .all method on resources should return the array [].
But, all those methods instead return instance of array #<Array:0x80e6023c>.

[1] pry(main)> nodes = conn.node.all
D, [2013-02-20T13:36:30.963304 #12378] DEBUG -- : [httplog] Sending: GET http://api.opscode.com:443/organizations/sachinlabs/nodes
D, [2013-02-20T13:36:31.578254 #12378] DEBUG -- : [httplog] Status: 200
D, [2013-02-20T13:36:31.578433 #12378] DEBUG -- : [httplog] Benchmark: 0.614688 seconds
D, [2013-02-20T13:36:31.578549 #12378] DEBUG -- : [httplog] Response:
{"prod-vm-i-7837be08":"https:\/\/api.opscode.com\/organizations\/sachinlabs\/nodes\/prod-vm-i-7837be08","product-wordpress-i-f3d2108f":"https:\/\/api.opscode.com\/organizations\/sachinlabs\/nodes\/product-wordpress-i-f3d2108f","test-vm-i-bce324cf":"https:\/\/api.opscode.com\/organizations\/sachinlabs\/nodes\/test-vm-i-bce324cf"}
=> #<Array:0x80e6023c>
[2] pry(main)> 

Due to this, I've to go inside and do more iteration.
Is this supposed to just return the values in array instead of the instance of array?

And how can I know that which chef version does the hosted opscode is running on?

SSL issues

Hey folks,

Any idea on how to get around SSL certificates verification issues please ?

rid = Ridley.new(
  server_url: "https://chef-server.example.com",
  client_name: ENV['KNIFE_VALIDATION_CLIENT_NAME'],
  client_key: ENV['KNIFE_VALIDATION_CLIENT_KEY']
)
rid.node.all

I remember something about SSL verify none but thats about it.

Error I'm getting:

    /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/responses.rb:29:in `value': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (Ridley::Errors::ConnectionFailed)
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in `_send_'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/pool_manager.rb:41:in `_send_'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/pool_manager.rb:122:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
      from (celluloid):0:in `remote procedure call'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:21:in `send'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/ridley-1.5.1/lib/ridley/resource.rb:132:in `raw_request'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/ridley-1.5.1/lib/ridley/resource.rb:123:in `request'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/ridley-1.5.1/lib/ridley/resource.rb:66:in `all'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
      from (celluloid):0:in `remote procedure call'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
      from /Users/scalp/.rvm/gems/ruby-1.9.3-p392@chef/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
      from ./route53_cleaning.rb:23:in `<main>'

Thanks in advance for any help!

Add ACL support to Objects

OHC/OPC supports ACLs for

  • clients
  • groups
  • containers
  • data
  • nodes
  • roles
  • cookbooks
  • sandboxes
  • environments

We should allow read/writing of these ACLs on the ChefObject level. The API seems to be undocumented but here is a Knife plugin which implements the API.

Use a string for client_key

I'd like to be able to use a string ratehr than a file name for the client key. If I use ridley with the key coming from an encrypted data bag it seems odd to have to write the key out to a file before using it. I could do a hack with a tmp file, but accepting a string would be useful.

Add 'no_proxy' support.

I'm experiencing this issue with Berkshelf but assume that the issue really resides in ridley. I am behind a corporate firewall. When I perform a 'berks upload' it grabs the http_proxy and https_proxy settings from my .chef/knife.rb and uses those settings to correctly download cookbooks from the opscode site (e.g., apache2). However when it then begins to upload the cookbooks to my chef-server which is inside my firewall it fails. It is trying to use the fire wall when it shouldn't.

Here are my relevant knife.rb values with domains changed to protect the innocent:
http_proxy "http://corpwall:80"
https_proxy "http://corpwall:80"
no_proxy "_corp.net,_intra,10.145.32.*"

Ridley::Chef::Config fails to parse `knife[:option] = value` configurations

Creating a new Ridley::Chef::Config instance fails if the knife configuration file has any "knife" Hash options.

For example with a knife.rb like this:

knife[:foo] = 'bar'
$ bundle exec ruby -e 'require "ridley"; Ridley::Chef::Config.new("knife.rb")'                                                                                                                                     
/Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:23:in `rescue in initialize': undefined local variable or method `knife' for #<Buff::Config::Ruby::Evaluator:0x007ff6a5187c40 @attributes={}> (Buff::Errors::InvalidConfig)
        from /Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:20:in `initialize'
        from /Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:14:in `new'
        from /Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:14:in `parse'
        from /Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:103:in `from_ruby'
        from /Users/tmatilai/.gem/ruby/2.0.0/gems/buff-config-0.3.0/lib/buff/config/ruby.rb:96:in `initialize'
        from /Users/tmatilai/.gem/ruby/2.0.0/bundler/gems/ridley-c2feba2ba005/lib/ridley/chef/config.rb:83:in `initialize'
        from -e:1:in `new'
        from -e:1:in `<main>'

This seems to be a restriction in Buff::Config::Ruby::Evaluator, and it breaks for example Berkshelf 3.0.

Should Evaluator#method_missing assign an empty hash by default? But how does it know we want a Hash and not e.g. an Array? Or do you have ideas how to handle this in Ridley?

Can't upload new cookbook to clean chef-server (11.4.0)

I put a fresh install of chef-server on a new ubuntu 12.04 box, then setup my mac laptop as a client. I confirmed I could use knife successfully to manage the server. Then I set up berkshelf with a tiny test cookbook that does basically nothing. when I run "berks upload" I get this: https://gist.github.com/9253075220c798414ea5

After I posted the above to the berkshelf channel on freenode, I was asked to create this issue. Happy to provide any info required.

Ridley::Mixin::ShellOut#mri_out does not work on Windows

Ridley::MIxin::ShellOut has an issue on Windows. It appears from @Enalmada's stacktrace (below) that Process.waitpid2 may not actually return a Process::Status object as it's second element.

C:\Users\Adam\Documents\chef-repo>berks upload -d
Using apt (2.0.0) at path
Uploading apt (2.0.0) to: 'https://api.opscode.com:443/organizations/mentormysel
fcom'
==> performing authenticated Chef request as 'enalmada'
request env: {:method=>:get, :body=>nil, :url=>#<Addressable::URI:0x1f82754 URI:
https://api.opscode.com:443/organizations/mentormyselfcom/cookbooks/apt/2.0.0>,
:request_headers=>{"Accept"=>"application/json", "Content-Type"=>"application/js
on", "X-Chef-Version"=>"11.4.0", "User-Agent"=>"Ridley v1.0.2", "X-OPS-SIGN"=>"a
lgorithm=sha1;version=1.0;", "X-OPS-USERID"=>"enalmada", "HOST"=>"api.opscode.com:443"}, :parallel_manage
r=>nil, :request=>{:proxy=>nil}, :ssl=>{:verify=>false}}
==> handling Chef response
request env: {:method=>:get, :body=>"{\"error\":[\"Cannot find a cookbook named
apt with version 2.0.0\"]}", :url=>#<Addressable::URI:0x1f82754 URI:https://api.
opscode.com:443/organizations/mentormyselfcom/cookbooks/apt/2.0.0>, :request_hea
ders=>{"Accept"=>"application/json", "Content-Type"=>"application/json", "X-Chef
-Version"=>"11.4.0", "User-Agent"=>"Ridley v1.0.2", "X-OPS-SIGN"=>"algorithm=sha
1;version=1.0;", "X-OPS-USERID"=>"enalmada", "X-OPS-TIMESTAMP"=>"2013-06-11T05:0
8:38Z", "X-OPS-CONTENT-HASH"=>"2jmj7l5rSw0yVb/vlWAYkK/YBwk=", "HOST"=>"api.opscode.com:443"}, :parallel_manager=>nil, :req
uest=>{:proxy=>nil}, :ssl=>{:verify=>false}, :status=>404, :response_headers=>{"
server"=>"ngx_openresty", "date"=>"Tue, 11 Jun 2013 05:08:38 GMT", "content-type
"=>"application/json; charset=utf-8", "transfer-encoding"=>"chunked", "connectio
n"=>"keep-alive", "status"=>"404 Not Found"}, :response=>#<Faraday::Response:0x3
f30f00 @env={...}, @on_complete_callbacks=[]>}
** error encounted in Chef response
Ridley::CookbookResource crashed!
NoMethodError: undefined method `exitstatus' for 0:Fixnum
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/shell_
out.rb:56:in `mri_out'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/shell_
out.rb:42:in `shell_out'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:141:in `validate_ruby_file'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:115:in `block in validate_ruby_files'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:114:in `each'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:114:in `validate_ruby_files'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k.rb:174:in `validate'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/resources/co
okbook_resource.rb:199:in `upload'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:25:in `public_send'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:25:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:67:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/actor
.rb:326:in `block in handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/tasks
.rb:42:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/tasks
/task_fiber.rb:11:in `block in create'
Ridley::SandboxResource crashed!
NoMethodError: undefined method `exitstatus' for 0:Fixnum
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/shell_
out.rb:56:in `mri_out'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/shell_
out.rb:42:in `shell_out'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:141:in `validate_ruby_file'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:115:in `block in validate_ruby_files'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:114:in `each'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k/syntax_check.rb:114:in `validate_ruby_files'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/cookboo
k.rb:174:in `validate'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/resources/co
okbook_resource.rb:199:in `upload'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:25:in `public_send'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:25:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:67:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/actor
.rb:326:in `block in handle_message'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/tasks
.rb:42:in `block in initialize'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/tasks
/task_fiber.rb:11:in `block in create'
        (celluloid):0:in `remote procedure call'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/calls
.rb:95:in `value'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/proxi
es/sync_proxy.rb:28:in `method_missing'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/legac
y.rb:14:in `method_missing'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/berksf
ile.rb:548:in `block in upload'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/berksf
ile.rb:543:in `each'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/berksf
ile.rb:543:in `upload'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/cli.rb
:230:in `upload'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:i
n `run'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:1
20:in `invoke_command'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `disp
atch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/cli.rb
:22:in `dispatch'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in
`start'
        C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/bin/berks:6:in `<top
 (required)>'
        C:/Ruby193/bin/berks:23:in `load'
        C:/Ruby193/bin/berks:23:in `<main>'
Terminating 7 actors...
Shutdown completed cleanly
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/shell_out.rb:5
6:in `mri_out': undefined method `exitstatus' for 0:Fixnum (NoMethodError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/mixin/s
hell_out.rb:42:in `shell_out'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/co
okbook/syntax_check.rb:141:in `validate_ruby_file'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/co
okbook/syntax_check.rb:115:in `block in validate_ruby_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/co
okbook/syntax_check.rb:114:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/co
okbook/syntax_check.rb:114:in `validate_ruby_files'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/chef/co
okbook.rb:174:in `validate'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ridley-1.0.2/lib/ridley/resourc
es/cookbook_resource.rb:199:in `upload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
calls.rb:25:in `public_send'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
calls.rb:25:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
calls.rb:67:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
actor.rb:326:in `block in handle_message'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
tasks.rb:42:in `block in initialize'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
tasks/task_fiber.rb:11:in `block in create'
        from (celluloid):0:in `remote procedure call'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
calls.rb:95:in `value'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
proxies/sync_proxy.rb:28:in `method_missing'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/celluloid-0.14.1/lib/celluloid/
legacy.rb:14:in `method_missing'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/b
erksfile.rb:548:in `block in upload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/b
erksfile.rb:543:in `each'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/b
erksfile.rb:543:in `upload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/c
li.rb:230:in `upload'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb
:27:in `run'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation
.rb:120:in `invoke_command'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in
`dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/lib/berkshelf/c
li.rb:22:in `dispatch'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:43
9:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/berkshelf-2.0.3/bin/berks:6:in
`<top (required)>'
        from C:/Ruby193/bin/berks:23:in `load'
        from C:/Ruby193/bin/berks:23:in `<main>'

Cookbook resource

Hi folks,

Any chance to have an example on how to use the cookbook resource please ?

Thanks in advance.

Some cookbooks fail to download with 0.11.2 and berkshelf 1.4.3

I upgraded to berkshelf 1.4.3 and got ridley 0.11.2 at the weekend. I've found that some cookbooks will fail to download from our chef server. They always throw the error:

/Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:135:in download_file': undefined method find' for nil:NilClass (NoMethodError)

As an example. I've got a toy cookbook that depends on apt, we are using the opscode apt cookbook. If it makes a difference, we've got several versions of the cookbook on the server:

gavin@gavin01:~/src/work/berks_testing/toy_cookbook[1]$ knife cookbook show apt
apt   1.9.0  1.2.2  1.1.2  1.1.1  0.9.0

The metadata:

gavin@gavin01:~/src/work/berks_testing/toy_cookbook[0]$ cat metadata.rb 
name             "toy_cookbook"
maintainer       "Gavin Sandie"
maintainer_email "[email protected]"
license          "All rights reserved"
description      "A toy cookbook"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version          "0.0.1"

depends "apt"

supports 'ubuntu'
supports 'amazon'

In both cases I'm starting from a blank berkshelf.

With berks 1.4.2 and ridley 0.9.1 the apt cookbook is downloaded ok:

gavin@gavin01:~/src/work/berks_testing/toy_cookbook[0]$ berks -v
Berkshelf (1.4.2)
gavin@gavin01:~/src/work/berks_testing/toy_cookbook[0]$ berks install
Using toy_cookbook (0.0.1) at path: '/Users/gavin/src/work/berks_testing/toy_cookbook'
Installing apt (1.9.0) from chef_api: 'https://api.opscode.com/organizations/digitalscience'

But with berks 1.4.3 and ridley 0.11.2 it fails:

gavin@gavin01:~/src/work/berks_testing/toy_cookbook[0]$ berks -v
Berkshelf (1.4.3)
gavin@gavin01:~/src/work/berks_testing/toy_cookbook[0]$ berks install
Using toy_cookbook (0.0.1) at path: '/Users/gavin/src/work/berks_testing/toy_cookbook'
/Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:135:in `download_file': undefined method `find' for nil:NilClass (NoMethodError)
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:91:in `block (2 levels) in download'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:88:in `each'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:88:in `block in download'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:85:in `each'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/ridley-0.11.2/lib/ridley/chef_objects/cookbook_object.rb:85:in `download'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/locations/chef_api_location.rb:154:in `download'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/downloader.rb:110:in `block in search_locations'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/downloader.rb:103:in `each'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/downloader.rb:103:in `search_locations'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/downloader.rb:79:in `download'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:133:in `install_source'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:53:in `add_source'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:77:in `block in add_source_dependencies'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:74:in `each'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:74:in `add_source_dependencies'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:31:in `block in initialize'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:30:in `each'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/resolver.rb:30:in `initialize'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/berksfile.rb:368:in `new'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/berksfile.rb:368:in `install'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/cli.rb:160:in `install'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/lib/berkshelf/cli.rb:17:in `dispatch'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/berkshelf-1.4.3/bin/berks:6:in `<top (required)>'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/bin/berks:23:in `load'
        from /Users/gavin/.rbenv/versions/1.9.3-p392/bin/berks:23:in `<main>'

Is there any further information I can give you to help with this issue?

EDIT: Fix ridley version

sandbox uploader crashes when traffic is forwarded from 80->4000

The sandbox uploader can crash when traffic is forwarded from 80->4000 and traffic to 4000 is blocked to the Chef server.

This is because the sandbox url to upload to includes the port 4000 as the destination but we actually want to upload to the configured port of the Ridley client, in this case 80.

Streaming outputs of chef runs and bootstrapping

When running multiple Ridley calls in simultaneous threads or when dealing with long-running bootstraps or chef runs, it would be nice to catch STDOUT and STDERR as it occurs, or at least force it to output (in realtime) in the context of a custom printf string. Does this seem reasonable, or am I missing an existing feature somewhere?

Ridley Sandbox crashes

Whenever I do a berks upload a few cookbooks will upload successfully then I get an error like the following.

Ridley::Sandbox crashed!
Ridley::Errors::HTTPBadRequest: errors: 'Cannot update sandbox 3a2c1cf0b3ce4f57b2951fc9f1b696a7: checksum 32145a5b40f1ef73c442bb02a300a98b was not uploaded'

It makes me really sad and I start crying.

I am using ruby 1.9.3p327 and ridley 0.6.2 and berkshelf 1.1.1

Replace Mixlib::ShellOut (fix JRuby support)

Mixlib::ShellOut is used in Ridley::Chef::Cookbook::SyntaxCheck to validate the syntax of cookbooks. It does so by shelling out to bin/erubis and bin/ruby.

Mixlib::ShellOut does not work on JRuby. A suggestion was made from @fujin to use spoon as an alternate shell out solution. There may also be safer primitives to use which are built into Ruby itself.

Another alternative would be to write a pure Ruby syntax checker which doesn't rely on shelling out

Add support for environment file uploads

I'd like to be able to upload environment files directly (I have an external "deploy" process which pins cookbooks to specific versions, and need to push my committed changes to the Chef server).

I'll try to figure this out (since it's my improvement) and submit a PR, but I won't be offended if @sethvargo knocks it out. :)

Incorrect error when SSH login fails

root password on a node was wrong, and mb gave the following error on bootstrap:

[2013-06-13T01:10:39Z] PID[32601] TID[oskzq88ds] INFO: Successfully ran SSH command on: '10.140.48.50' as: 'root' but it failed

Seems like it's not detecting SSH failures properly.

Pulled in from: RiotGamesMinions/motherbrain#566

"Boolean is not a module" error on start up

Hi, I'm trying to use ridley, but whenever I start up my rack webservice, I get an error thrown whenever I try to use ridley in my app. It seems to happen whenever I even just do "require 'ridley'".

Do you have any idea what this might be coming from?

/home/adan/.rvm/gems/ruby-1.9.3-p448/gems/buff-extensions-0.5.0/lib/buff/extensions/boolean.rb:1:in `<top (required)>': Boolean is not a module (TypeError)
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/buff-extensions-0.5.0/lib/buff/extensions.rb:7:in `require_relative'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/buff-extensions-0.5.0/lib/buff/extensions.rb:7:in `<top (required)>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/varia_model-0.1.1/lib/varia_model.rb:1:in `require'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/varia_model-0.1.1/lib/varia_model.rb:1:in `<top (required)>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/ridley-1.5.0/lib/ridley/chef_object.rb:1:in `require'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/ridley-1.5.0/lib/ridley/chef_object.rb:1:in `<top (required)>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/ridley-1.5.0/lib/ridley.rb:69:in `require_relative'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/ridley-1.5.0/lib/ridley.rb:69:in `<module:Ridley>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/ridley-1.5.0/lib/ridley.rb:13:in `<top (required)>'
    from /home/adan/myApp/app/management_api_app.rb:3:in `require'
    from /home/adan/myApp/app/management_api_app.rb:3:in `<top (required)>'
    from /home/adan/myApp/config.ru:23:in `require'
    from /home/adan/myApp/config.ru:23:in `block in <main>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
    from /home/adan/myApp/config.ru:in `new'
    from /home/adan/myApp/config.ru:in `<main>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:49:in `eval'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:49:in `new_from_string'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/builder.rb:40:in `parse_file'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/server.rb:277:in `build_app_and_options_from_config'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/server.rb:199:in `app'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/server.rb:314:in `wrapped_app'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/server.rb:250:in `start'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/lib/rack/server.rb:141:in `start'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/gems/rack-1.5.2/bin/rackup:4:in `<top (required)>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/bin/rackup:19:in `load'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/bin/rackup:19:in `<main>'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
    from /home/adan/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'

MB makes excessive connections to chef server?

I was diagnosing an MB issue (kept failing) and added some puts inside ruby lib code (below); but what i counted were 266 connections made during a: "mb plugins --remote" run. Why so many? And the run took 1.5 minutes. BTW, this was from an ubuntu VM running on a windows host.

def connect # :nodoc:
D "opening connection to #{conn_address()}..."
@@conn_count += 1
puts "OPENING..#{@@conn_count}"
s = timeout(@open_timeout) { TCPSocket.open(conn_address(), conn_port()) }
D "opened"
....

NoMethodError: private method `load' called for MultiJson:Module

conn.client.all
NoMethodError: private method load' called for MultiJson:Module from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/middleware/parse_json.rb:27:inparse'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/middleware/parse_json.rb:99:in on_complete' from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:9:inblock in call'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:63:in on_complete' from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:incall'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/response.rb:8:in call' from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/middleware/chef_auth.rb:31:incall'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:226:in run_request' from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/faraday-0.8.4/lib/faraday/connection.rb:87:inget'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/resource.rb:115:in find!' from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/resource.rb:101:infind'
from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ridley-0.0.2/lib/ridley/context.rb:22:in method_missing' from (irb):7 from /Users/michael.ivey/.rbenv/versions/1.9.2-p290/bin/irb:12:in

'

Fiber stack errors

Hi,

When trying berks install using a private hosted chef repo (with chef_api :config in Berksfile), I've stumbled across this problem:

% berks install                          
Using sumd (0.0.1) at path: '/home/goblin/git/central-chef-cookbooks/cookbooks/sumd'
Ridley::Connection crashed!
Celluloid::FiberStackError: stack level too deep (please see https://github.com/celluloid/celluloid/wiki/Fiber-stack-errors)
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/tasks/task_fiber.rb:53:in `rescue in resume'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/tasks/task_fiber.rb:50:in `resume'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:419:in `task'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:326:in `handle_message'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:183:in `run'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:171:in `block in initialize'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/thread_handle.rb:12:in `block in initialize'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/internal_pool.rb:55:in `call'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/internal_pool.rb:55:in `block in create'
Celluloid::PoolManager crashed!
Celluloid::FiberStackError: stack level too deep (please see https://github.com/celluloid/celluloid/wiki/Fiber-stack-errors)
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/tasks/task_fiber.rb:53:in `rescue in resume'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/tasks/task_fiber.rb:50:in `resume'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/responses.rb:11:in `dispatch'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:328:in `handle_message'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:183:in `run'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/actor.rb:171:in `block in initialize'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/thread_handle.rb:12:in `block in initialize'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/internal_pool.rb:55:in `call'
        /home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/internal_pool.rb:55:in `block in create'
/home/goblin/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/celluloid-0.13.0/lib/celluloid/responses.rb:29: stack level too deep (SystemStackError)

As per the first workaround described at https://github.com/celluloid/celluloid/wiki/Fiber-stack-errors I've added task_class TaskThread to each Ridley class that includes Celluloid. That helped.

I've done the change against both Ridley 0.9 (one required by Berkshelf) and the latest master.

I can submit a pull request but I'm not sure against which version of Ridley I should do it?

It should also be possible to provide the client_key as a string

I'm using Ridley to update some data bags after a Travis-CI run. Mainly to implement continuous deployment. For that I was thinking of putting the chef config - including the client key - into a secure travis ENV variable.

Currently ridley only accepts a path to a client .pem file. Does it make sense to generally change that and add the option to provide the client_key as a String?
I think this would allow greater flexibility in general. What do you think? I'd be happy to change that if you think it's generally interesting.

Data Bag Creation Expects a Hash

Taken from the Yard Documentation, the way to create a Data Bag

ridley = Ridley.new(...)
ridley.data_bag.create("ridley-test")

However we get an error:

ridley = Ridley.new(...)
ridley.data_bag.create("ridley-test")
Ridley::DataBagResource crashed!
NoMethodError: undefined method `to_hash' for "ridley-test":String
    /usr/local/lib/ruby/gems/1.9.1/gems/ridley-0.12.4/lib/ridley/resource.rb:67:in `create'
...snip celluloid trace...

This will work:

ridley = Ridley.new(...)
ridley.data_bag.create(name: "ridley-test")

As will this:

ridley = Ridley.new(...)
ridley.data_bag.create(name: "ridley-test", id: "foo", host: "bar")

Although the extra parameters are discarded.

Raw request mode

When debugging, it would be nice to be able to specify an arbitrary URL and have Ridley sign it appropriately and send it along.

Berkshelf Upload Failed - server certificate

Trying to upload to a Chef 11 server with Berkshelf over HTTPS. The Chef server has a full certificate, not a self-signed cert.

Uploading mycoookbook (0.2.1) to: 'https://chef.example.com:443/'
Ridley::Errors::ConnectionFailed: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/responses.rb:29:in `value'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:25:in `_send_'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/pool_manager.rb:41:in `_send_'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/pool_manager.rb:122:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
(celluloid):0:in `remote procedure call'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/proxies/actor_proxy.rb:21:in `send'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/ridley-1.0.2/lib/ridley/resource.rb:112:in `raw_request'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/ridley-1.0.2/lib/ridley/resource.rb:103:in `request'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/ridley-1.0.2/lib/ridley/resources/cookbook_resource.rb:92:in `find'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/ridley-1.0.2/lib/ridley/resources/cookbook_resource.rb:190:in `upload'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `public_send'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:25:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:67:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/actor.rb:326:in `block in handle_message'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/tasks.rb:42:in `block in initialize'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/tasks/task_fiber.rb:11:in `block in create'
(celluloid):0:in `remote procedure call'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/calls.rb:95:in `value'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/proxies/sync_proxy.rb:28:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/celluloid-0.14.1/lib/celluloid/legacy.rb:14:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/lib/berkshelf/berksfile.rb:548:in `block in upload'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/lib/berkshelf/berksfile.rb:543:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/lib/berkshelf/berksfile.rb:543:in `upload'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/lib/berkshelf/cli.rb:230:in `upload'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/lib/berkshelf/cli.rb:22:in `dispatch'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
/usr/local/rvm/gems/ruby-1.9.3-p429/gems/berkshelf-2.0.3/bin/berks:6:in `<top (required)>'
/usr/local/rvm/gems/ruby-1.9.3-p429/bin/berks:19:in `load'
/usr/local/rvm/gems/ruby-1.9.3-p429/bin/berks:19:in `<main>'
/usr/local/rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `eval'
/usr/local/rvm/gems/ruby-1.9.3-p429/bin/ruby_noexec_wrapper:14:in `<main>'
There was an error connecting to the Chef Server

Ridley::Mock

It would be nice if you could require "ridley/mock" in your test helper, and have all operations skip actually talking to chef, returning empty hashes or fake data as appropriate. Would make working inside Ridley.sync blocks much nicer to test.

Getting Ridley::Errors::ConnectionFailed when using Ridley on Windows

ridley version 1.2.2

require 'ridley'
require 'pathname'

client = 'foo'
path_to_pem = Pathname.new('c:\foo.pem').to_s
opscode = 'https://api.opscode.com/organizations/facetwit'
ridley = Ridley.new(server_url: opscode, client_name: client, client_key: path_to_pem)
ridley.role.all

...results in this error: https://gist.github.com/stensonb/5806361

This same code works on my Mac, using the same ruby patchlevel, same gems, same client name, client pem, etc.

I suspect the windows pathing isn't working correctly, but calling "ridley.client_key" seems to indicate the pathing is working properly:

irb(main):012:0* ridley.client_key
=> "c:/foo.pem"
irb(main):013:0>

Number of threads explosion on JRuby

We're unable to test Ridley on JRuby because there seems to be an absorbent amount of threads that are never cleaned up. The test suite will run until you can't allocate anymore native threads for the process.

This was a problem on MRI until we added this line to the RSpec config

config.before(:each) do
  Celluloid.shutdown
  Celluloid.boot
end

Either it does not seem to be working on JRuby, or the recent changes to Chef-Zero are not cleaning up properly after themselves when injected into our test suite.

Integrate chef-zero for user tests

Ridley.testing! should spin up a chef zero server and silently replace all Ridley connections to point to that server instead. This would allow seamless testing of Ridley based applications without any additional work, or special mock classes for everything.

Celluloid::DeadActorError

Getting this when trying to query anything using Ridley

conn.nodes.all
Celluloid::DeadActorError: attempted to call a dead actor

undefined method `new' for Ridley:Module ?

In the README, there is the code:

conn = Ridley.new(...)

But it throws error:

[13] pry(main)> con = Ridley.new
NoMethodError: undefined method `new' for Ridley:Module
from (pry):10:in `__pry__'
[14] pry(main)> 

Is the README correct?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.