Skip to content
Browse files

Adding features for synchronization, fixing bugs in remote_directory,…

… client, and compile, adding specs for cookbook selectivity
  • Loading branch information...
1 parent 8e1d147 commit d402fb984ca6d6e93821dab045a5bfdfa7e7bebd @adamhjk adamhjk committed May 26, 2009
Showing with 464 additions and 42 deletions.
  1. +17 −2 Rakefile
  2. +1 −1 chef-server-slice/app/controllers/exceptions.rb
  3. +1 −1 chef-server-slice/app/controllers/nodes.rb
  4. +217 −0 chef-server-slice/app/views/exceptions/standard_error.html.erb
  5. +1 −0 chef/lib/chef/client.rb
  6. +1 −0 chef/lib/chef/compile.rb
  7. +1 −1 chef/lib/chef/provider/remote_directory.rb
  8. +7 −1 chef/spec/unit/cookbook_loader_spec.rb
  9. +1 −1 chef/spec/unit/provider/link_spec.rb
  10. +5 −1 cucumber.yml
  11. +16 −16 example-repository/cookbooks/fakefile/metadata.json
  12. +16 −16 example-repository/cookbooks/tempfile/metadata.json
  13. +1 −0 features/api/nodes/create_node_api.feature
  14. +1 −0 features/api/nodes/delete_node_api.feature
  15. +1 −0 features/api/nodes/list_nodes_api.feature
  16. +1 −0 features/api/nodes/show_node_api.feature
  17. +1 −0 features/api/nodes/update_node_api.feature
  18. +1 −0 features/api/roles/create_role_api.feature
  19. +1 −0 features/api/roles/delete_role_api.feature
  20. +1 −0 features/api/roles/list_roles_api.feature
  21. +1 −0 features/api/roles/show_roles_api.feature
  22. +1 −0 features/api/roles/update_roles_api.feature
  23. +21 −0 features/chef-client/cookbook_sync.feature
  24. +2 −1 features/chef-client/run_interval.feature
  25. +1 −0 features/cookbooks/metadata.feature
  26. +18 −0 features/data/cookbooks/synchronize/recipes/default.rb
  27. +39 −0 features/data/cookbooks/synchronize_deps/metadata.json
  28. +1 −0 features/data/cookbooks/synchronize_deps/metadata.rb
  29. +18 −0 features/data/cookbooks/synchronize_deps/recipes/default.rb
  30. +59 −0 features/data/cookbooks/transfer_remote_files/metadata.json
  31. +1 −0 features/data/cookbooks/transfer_remote_files/metadata.rb
  32. +1 −0 features/provider/remote_file/transfer_remote_files.feature
  33. +6 −0 features/steps/node_steps.rb
  34. +1 −1 features/steps/run_client_steps.rb
  35. +2 −0 features/support/env.rb
View
19 Rakefile
@@ -134,6 +134,21 @@ namespace :dev do
end
Cucumber::Rake::Task.new(:features) do |t|
- t.step_pattern = 'features/steps/**/*.rb'
- t.cucumber_opts = "--format pretty -r features/support/env.rb"
+ t.profile = "default"
+end
+
+namespace :features do
+ Cucumber::Rake::Task.new(:api) do |t|
+ t.profile = "api"
+ end
+
+ Cucumber::Rake::Task.new(:client) do |t|
+ t.profile = "client"
+ end
+
+ namespace :provider do
+ Cucumber::Rake::Task.new(:remote_file) do |t|
+ t.profile = "provider_remote_file"
+ end
+ end
end
View
2 chef-server-slice/app/controllers/exceptions.rb
@@ -26,7 +26,7 @@ def standard_error
if request.accept =~ /application\/json/
display({ "error" => request.exceptions })
else
- display(params)
+ raise request.exceptions.first
end
end
View
2 chef-server-slice/app/controllers/nodes.rb
@@ -111,7 +111,7 @@ def update
display(@node)
else
begin
- @node.run_list(params[:for_node])
+ @node.run_list.reset(params[:for_node] ? params[:for_node] : [])
@node.attribute = JSON.parse(params[:attributes])
@node.save
@_message = { :notice => "Updated Node" }
View
217 chef-server-slice/app/views/exceptions/standard_error.html.erb
@@ -0,0 +1,217 @@
+<html>
+<head>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+ <title><%= @exception_name %></title>
+ <style type="text/css" media="screen">
+ body {
+ font-family:arial;
+ font-size:11px;
+ }
+ h1 {
+ font-size:48px;
+ letter-spacing:-4px;
+ margin:0;
+ line-height:36px;
+ color:#333;
+ }
+ h1 sup {
+ font-size: 0.5em;
+ }
+ h1 sup.error_500, h1 sup.error_400 {
+ color:#990E05;
+ }
+ h1 sup.error_100, h1 sup.error_200 {
+ color:#00BF10;
+ }
+ h1 sup.error_300 {
+ /* pretty sure you cant 'see' status 300
+ errors but if you could I think they
+ would be blue */
+ color:#1B2099;
+ }
+ h2 {
+ font-size:36px;
+ letter-spacing:-3px;
+ margin:0;
+ line-height:28px;
+ color:#444;
+ }
+ a, a:visited {
+ color:#00BF10;
+ }
+ .internalError {
+ width:800px;
+ margin:50px auto;
+ }
+ .header {
+ border-bottom:10px solid #333;
+ margin-bottom:1px;
+ background-image: url("data:image/gif;base64,R0lGODlhAwADAIAAAP///8zMzCH5BAAAAAAALAAAAAADAAMAAAIEBHIJBQA7");
+ padding:20px;
+ }
+ table.trace {
+ width:100%;
+ font-family:courier, monospace;
+ letter-spacing:-1px;
+ border-collapse: collapse;
+ border-spacing:0;
+ }
+ table.trace tr td{
+ padding:0;
+ height:26px;
+ font-size:13px;
+ vertical-align:middle;
+ }
+ table.trace tr.file{
+ border-top:2px solid #fff;
+ background-color:#F3F3F3;
+ }
+ table.trace tr.source {
+ background-color:#F8F8F8;
+ display:none;
+ }
+ table.trace .open tr.source {
+ display:table-row;
+ }
+ table.trace tr.file td.expand {
+ width:23px;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAAXCAIAAABvSEP3AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAdVJREFUeNqMVL+TwUAYxaRIOlEhlZHGDAUzzOQ61+AqXMV1lJSU7q/QRqm8KFUcJTNn5qJkaPyoKKVz7y4mF8na5Kt29tt9+/Z97/u81+vVQ4r9frdarS6Xi7ETDIZisRjxMGPfmk4niNPpZE+xLAugbPaZ53nzvtfMBe/3+/3dbuehBrAKhZdUKkVAWa9Xsiybv0CPZDJZLr/qa5/BwgwRjYqOKIvFYjQa/aNommZh0Ww2K5UqzwfoQOPxaLPZ3FAmk0+7lplMpt1u53J5OpBOR0eZEE9wHJfP5zud93g88QhluwWbjW+5VOmKBgKBer3eaDTDYeGBQF8+x7rqIYoiPgixWJazpA6HA+MSxRArkUgMh0M409g8Ho8+9wYxxCqVSq1W26EDHGM2m4HOHQrEc38f/Yn7cLmlIRhBENzcx8cVRZnPZ/YUep2BWkjTIfA+PKVpZAXR5QxsjiqCKvGEqqp443w+0dvy17swqD0HB3S73V5PpkNg1qBqt8kwGCjmPkinM0QJbIoEa7U6UG6ToVgs4V9G2g0ESoP5Aoi7KYX5oCgf8IKbkvn9/mr1LRQKESamzgJy0g0tSZIuB3nuGqRU9Vv9C4sKkUhEkp4soxvxI8AAhWrrtXa3X8EAAAAASUVORK5CYII=);
+ background-position:top left;
+ background-repeat:no-repeat;
+ }
+ table.trace .open tr.file td.expand {
+ width:19px;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAXZJREFUeNrslK1ywkAUhcMOBomEOiSdqLxEBJX0NaijOsjyHGGmCGyQQYaiiiw4gktkcOmZbpsuuzQ/M5XnqJ2d3S/n3nM3rTzPLUP7/Tt0+pLcGQwG3W53OLyHzPMtjYL7q9UqSRLrD4E1Gj1orCvKYuFHUWTVkOM44/HjDcp8/lL4r6NerzeZPMm1KFw0QkDn83m5fP2lHA4fNQvRtNvtjsfDd0WzmSfb2e/fdTqdOvdh/HLJZLOn0+d2HJ+KRGzbdl23EpFlmed5cp2maRzHQq1lvQ5KMi6EUZBGfup6E1pTfd+vrGW7jbQ2C9hTt9BpqNyIWaAwAy6xg2eBz5iRC/NomiZhGN5sqmnkauo0BUGgVQoBjQ80oCACgNQdZHfTYBkF2mxCtWWAqunWpahxIDUt3QYUxIFQpJHyIWpXjinabKbbwItMHT+NyjchrP8QKaSQQgoppJBCCimkkEIKKaSQQgoppJBCCimkkEIKKaSo+hRgAEFD17X08O2NAAAAAElFTkSuQmCC);
+ background-position:top left;
+ background-repeat:no-repeat;
+ }
+ table.trace tr.source td.collapse {
+ width:19px;
+ background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABcAAAB1CAIAAAAqdO2mAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAVxJREFUeNrs0zFygkAUBmBlUkgJHdABlQwVkVJKKUxBYWbkALTxMJwhltyDFkss03IF8pudIcwaDaDl/6pd2P327b7d+eHwMXs4lNkzggoVKlSoUKFChQoVKlSoUKFChQoVKlSoUKFChQqVEYqm6ft9+qiSJEkYho7jTlcw2fd9NOI4nq4gEdFwXXe1Cqco63VkWVbXRTqLhTpOwQRpF7quR1E0TgGhqvLKUFCyoQqG/rks3O6kZKW/eRFpevOCoGTXVTcMQ5EyxyDEkML1c5RzuZOICIyXqn7JBVez6282MWrx731HOv2qB8Hri2lamNk0DfpVVdV1Peodappmmua8bdvzuc7zfNprzrLMth1FnGh/X8MjCAIQv/cFz/+65PcDh7rbvYv2ZUfdj+PxsyzLgVl0hKwgTqeqKApx2LeOc7t98zyv/1FWOgvx9RPii23bmL9cetJ8Ed8CDAC6aFW8bCzFhwAAAABJRU5ErkJggg==);
+ background-position:bottom left;
+ background-repeat:no-repeat;
+ background-color:#6F706F;
+ }
+ table.trace tr td.path {
+ padding-left:10px;
+ }
+ table.trace tr td.code {
+ padding-left:35px;
+ white-space: pre;
+ line-height:9px;
+ padding-bottom:10px;
+ }
+ table.trace tr td.code em {
+ font-weight:bold;
+ color:#00BF10;
+ }
+ table.trace tr td.code a {
+ width: 20px;
+ float: left;
+ }
+ table.trace tr td.code .more {
+ color:#666;
+ }
+ table.trace tr td.line {
+ width:30px;
+ text-align:right;
+ padding-right:4px;
+ }
+ .footer {
+ margin-top:5px;
+ font-size:11px;
+ color:#444;
+ text-align:right;
+ }
+ </style>
+</head>
+<body>
+ <div class="internalError">
+
+ <div class="header">
+ <h1><%= @exception_name %> <sup class="error_<%= @exception.class::STATUS %>"><%= @exception.class::STATUS %></sup></h1>
+ <% if show_details = ::Merb::Config[:exception_details] -%>
+ <h2><%= @exception.message %></h2>
+ <% else -%>
+ <h2>Sorry about that...</h2>
+ <% end -%>
+ <h3>Parameters</h3>
+ <ul>
+ <% params[:original_params].each do |param, value| %>
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
+ <% end %>
+ <%= "<li>None</li>" if params[:original_params].empty? %>
+ </ul>
+
+ <h3>Session</h3>
+ <ul>
+ <% params[:original_session].each do |param, value| %>
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
+ <% end %>
+ <%= "<li>None</li>" if params[:original_session].empty? %>
+ </ul>
+
+ <h3>Cookies</h3>
+ <ul>
+ <% params[:original_cookies].each do |param, value| %>
+ <li><strong><%= param %>:</strong> <%= value.inspect %></li>
+ <% end %>
+ <%= "<li>None</li>" if params[:original_cookies].empty? %>
+ </ul>
+ </div>
+
+ <% if show_details %>
+ <table class="trace">
+ <% @exception.backtrace.each_with_index do |line, index| %>
+ <tbody class="close">
+ <tr class="file">
+ <td class="expand">
+ </td>
+ <td class="path">
+ <%= (line.match(/^([^:]+)/)[1] rescue 'unknown').sub(/\/((opt|usr)\/local\/lib\/(ruby\/)?(gems\/)?(1.8\/)?(gems\/)?|.+\/app\/)/, '') %>
+ <% unless line.match(/\.erb:/) %>
+ in "<strong><%= line.match(/:in `(.+)'$/)[1] rescue '?' %></strong>"
+ <% else %>
+ (<strong>ERB Template</strong>)
+ <% end %>
+ </td>
+ <td class="line">
+ <a href="txmt://open?url=file://<%=file = (line.match(/^([^:]+)/)[1] rescue 'unknown')%>&amp;line=<%= lineno = line.match(/:([0-9]+):/)[1] rescue '?' %>"><%=lineno%></a>&nbsp;
+ </td>
+ </tr>
+ <tr class="source">
+ <td class="collapse">
+ </td>
+ <td class="code" colspan="2"><% (__caller_lines__(file, lineno, 5) rescue []).each do |llineno, lcode, lcurrent| %>
+<a href="txmt://open?url=file://<%=file%>&amp;line=<%=llineno%>"><%= llineno %></a><%='<em>' if llineno==lineno.to_i %><%= lcode.size > 90 ? CGI.escapeHTML(lcode[0..90])+'<span class="more">......</span>' : CGI.escapeHTML(lcode) %><%='</em>' if llineno==lineno.to_i %>
+<% end %>
+
+</td>
+ </tr>
+ </tbody>
+ <% end %>
+ </table>
+ <script type="text/javascript" charset="utf-8">
+ // swop the open & closed classes
+ els = document.getElementsByTagName('td');
+ for(i=0; i<els.length; i++){
+ if(els[i].className=='expand' || els[i].className=='collapse'){
+ els[i].onclick = function(e){
+ tbody = this.parentNode.parentNode;
+ if(tbody.className=='open'){
+ tbody.className='closed';
+ }else{
+ tbody.className='open';
+ }
+ }
+ }
+ }
+ </script>
+ <% end %>
+ <div class="footer">
+ lots of love, from <a href="#">merb</a>
+ </div>
+ </div>
+</body>
+</html>
+
View
1 chef/lib/chef/client.rb
@@ -23,6 +23,7 @@
require 'chef/rest'
require 'chef/platform'
require 'chef/node'
+require 'chef/role'
require 'chef/file_cache'
require 'chef/compile'
require 'chef/runner'
View
1 chef/lib/chef/compile.rb
@@ -18,6 +18,7 @@
require 'chef/cookbook_loader'
require 'chef/resource_collection'
require 'chef/node'
+require 'chef/role'
require 'chef/log'
class Chef
View
2 chef/lib/chef/provider/remote_directory.rb
@@ -80,7 +80,7 @@ def fetch_remote_file(remote_file_source)
@new_resource.updated = true if rf_provider.new_resource.updated
end
- def create_directory
+ def create_directory(full_dir)
new_dir = Chef::Resource::Directory.new(full_dir, nil, @node)
new_dir.cookbook_name = @new_resource.cookbook || @new_resource.cookbook_name
new_dir.mode(@new_resource.mode)
View
8 chef/spec/unit/cookbook_loader_spec.rb
@@ -127,6 +127,12 @@
f =~ /\.dotfile$/
}.should =~ /\.dotfile$/
end
+
+ it "should load the metadata for the cookbook" do
+ @cl.metadata[:openldap].name.should == :openldap
+ @cl.metadata[:openldap].should be_a_kind_of(Chef::Cookbook::Metadata)
+ end
+
end
-end
+end
View
2 chef/spec/unit/provider/link_spec.rb
@@ -56,7 +56,7 @@
Chef::Resource::Link.stub!(:new).and_return(@current_resource)
File.stub!(:exists?).and_return(true)
File.stub!(:symlink?).and_return(true)
- File.stub!(:readlink).and_return("")
+ File.stub!(:readlink).and_return("")
end
it "should set the symink target" do
View
6 cucumber.yml
@@ -1 +1,5 @@
-default: --format pretty -r features/steps -r features/support features
+default: -f pretty features -r features/steps -r features/support
+api: --tags api --format pretty -r features/steps -r features/support features
+client: --tags client --format pretty -r features/steps -r features/support features
+provider_remote_file: --tags provider,remote_file --format pretty -r features/steps -r features/support features
+
View
32 example-repository/cookbooks/fakefile/metadata.json
@@ -1,6 +1,13 @@
{
- "maintainer": "Your Name",
- "recommendations": {
+ "maintainer_email": "youremail@example.com",
+ "recipes": {
+ "fakefile": ""
+ },
+ "suggestions": {
+
+ },
+ "license": "Apache v2.0",
+ "conflicting": {
},
"dependencies": {
@@ -11,32 +18,25 @@
]
},
- "maintainer_email": "youremail@example.com",
"attributes": {
},
- "suggestions": {
-
- },
"name": "fakefile",
- "license": "Apache v2.0",
- "conflicting": {
-
- },
"providing": {
"fakefile": [
]
},
- "description": "A fabulous new cookbook",
- "recipes": {
- "fakefile": ""
- },
"replacing": {
},
- "platforms": {
+ "long_description": "",
+ "description": "A fabulous new cookbook",
+ "maintainer": "Your Name",
+ "recommendations": {
},
- "long_description": ""
+ "platforms": {
+
+ }
}
View
32 example-repository/cookbooks/tempfile/metadata.json
@@ -1,39 +1,39 @@
{
- "maintainer": "Your Name",
- "recommendations": {
+ "maintainer_email": "youremail@example.com",
+ "recipes": {
+ "tempfile": ""
+ },
+ "suggestions": {
+
+ },
+ "license": "Apache v2.0",
+ "conflicting": {
},
"dependencies": {
"fakefile": [
]
},
- "maintainer_email": "youremail@example.com",
"attributes": {
},
- "suggestions": {
-
- },
"name": "tempfile",
- "license": "Apache v2.0",
- "conflicting": {
-
- },
"providing": {
"tempfile": [
]
},
- "description": "A fabulous new cookbook",
- "recipes": {
- "tempfile": ""
- },
"replacing": {
},
- "platforms": {
+ "long_description": "",
+ "description": "A fabulous new cookbook",
+ "maintainer": "Your Name",
+ "recommendations": {
},
- "long_description": ""
+ "platforms": {
+
+ }
}
View
1 features/api/nodes/create_node_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Create a node via the REST API
In order to create nodes programatically
As a Devleoper
View
1 features/api/nodes/delete_node_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Delete a node via the REST API
In order to remove a node
As a Developer
View
1 features/api/nodes/list_nodes_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: List nodes via the REST API
In order to know what nodes exists programatically
As a Developer
View
1 features/api/nodes/show_node_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Show a node via the REST API
In order to know what the details are for a node
As a Developer
View
1 features/api/nodes/update_node_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Update a node
In order to keep my node data up-to-date
As a Developer
View
1 features/api/roles/create_role_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Create a role via the REST API
In order to create roles programatically
As a Devleoper
View
1 features/api/roles/delete_role_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Delete a Role via the REST API
In order to remove a role
As a Developer
View
1 features/api/roles/list_roles_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: List roles via the REST API
In order to know what roles exists programatically
As a Developer
View
1 features/api/roles/show_roles_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Show a role via the REST API
In order to know what the details are for a Role
As a Developer
View
1 features/api/roles/update_roles_api.feature
@@ -1,3 +1,4 @@
+@api
Feature: Update a role
In order to keep my role data up-to-date
As a Developer
View
21 features/chef-client/cookbook_sync.feature
@@ -0,0 +1,21 @@
+@client
+Feature: Synchronize cookbooks from the server
+ In order to configure a system according to a centralized repository
+ As an Administrator
+ I want to synchronize cookbooks to the edge nodes
+
+ Scenario: Synchronize specific cookbooks
+ Given a validated node
+ And it includes the recipe 'synchronize'
+ When I run the chef-client with '-l info'
+ Then the run should exit '0'
+ And 'stdout' should have 'INFO: Storing updated cookbooks/synchronize/recipes/default.rb in the cache.'
+
+ Scenario: Synchronize dependent cookbooks
+ Given a validated node
+ And it includes the recipe 'synchronize_deps'
+ When I run the chef-client with '-l info'
+ Then the run should exit '0'
+ And 'stdout' should have 'INFO: Storing updated cookbooks/synchronize_deps/recipes/default.rb in the cache.'
+ And 'stdout' should have 'INFO: Storing updated cookbooks/synchronize/recipes/default.rb in the cache.'
+
View
3 features/chef-client/run_interval.feature
@@ -1,3 +1,4 @@
+@client
Feature: Run chef-client at periodic intervals
In order to ensure a system is always correctly configured
As an Administrator
@@ -7,6 +8,6 @@ Feature: Run chef-client at periodic intervals
Given a validated node
And it includes the recipe 'run_interval'
When I run the chef-client with '-l info -i 5' for '10' seconds
- Then the run should exit from being signaled
+ Then the run should exit '2'
And 'INFO: Starting Chef Run' should appear on 'stdout' '2' times
View
1 features/cookbooks/metadata.feature
@@ -1,3 +1,4 @@
+@cookbooks
Feature: Cookbook Metadata
In order to understand cookbooks without evaluating them
As an Administrator
View
18 features/data/cookbooks/synchronize/recipes/default.rb
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: synchronize
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
View
39 features/data/cookbooks/synchronize_deps/metadata.json
@@ -0,0 +1,39 @@
+{
+ "maintainer_email": "youremail@example.com",
+ "recipes": {
+ "synchronize_deps": ""
+ },
+ "suggestions": {
+
+ },
+ "license": "Apache v2.0",
+ "conflicting": {
+
+ },
+ "dependencies": {
+ "synchronize": [
+
+ ]
+ },
+ "attributes": {
+
+ },
+ "name": "synchronize_deps",
+ "providing": {
+ "synchronize_deps": [
+
+ ]
+ },
+ "replacing": {
+
+ },
+ "long_description": "",
+ "description": "A fabulous new cookbook",
+ "maintainer": "Your Name",
+ "recommendations": {
+
+ },
+ "platforms": {
+
+ }
+}
View
1 features/data/cookbooks/synchronize_deps/metadata.rb
@@ -0,0 +1 @@
+depends 'synchronize'
View
18 features/data/cookbooks/synchronize_deps/recipes/default.rb
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: synchronize_deps
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
View
59 features/data/cookbooks/transfer_remote_files/metadata.json
@@ -0,0 +1,59 @@
+{
+ "maintainer_email": "youremail@example.com",
+ "recipes": {
+ "transfer_remote_files::transfer_a_file_from_a_cookbook": "",
+ "transfer_remote_files::should_prefer_the_file_for_this_specific_host": "",
+ "transfer_remote_files::transfer_a_file_from_a_specific_cookbook": "",
+ "transfer_remote_files::transfer_a_non-existent_file_from_a_cookbook": "",
+ "transfer_remote_files": "",
+ "transfer_remote_files::change_remote_file_perms_trickery": ""
+ },
+ "suggestions": {
+
+ },
+ "license": "Apache v2.0",
+ "conflicting": {
+
+ },
+ "dependencies": {
+ "transfer_remote_files_definition": [
+
+ ]
+ },
+ "attributes": {
+
+ },
+ "name": "transfer_remote_files",
+ "providing": {
+ "transfer_remote_files": [
+
+ ],
+ "transfer_remote_files::transfer_a_file_from_a_cookbook": [
+
+ ],
+ "transfer_remote_files::should_prefer_the_file_for_this_specific_host": [
+
+ ],
+ "transfer_remote_files::transfer_a_file_from_a_specific_cookbook": [
+
+ ],
+ "transfer_remote_files::transfer_a_non-existent_file_from_a_cookbook": [
+
+ ],
+ "transfer_remote_files::change_remote_file_perms_trickery": [
+
+ ]
+ },
+ "replacing": {
+
+ },
+ "long_description": "",
+ "description": "A fabulous new cookbook",
+ "maintainer": "Your Name",
+ "recommendations": {
+
+ },
+ "platforms": {
+
+ }
+}
View
1 features/data/cookbooks/transfer_remote_files/metadata.rb
@@ -0,0 +1 @@
+depends "transfer_remote_files_definition"
View
1 features/provider/remote_file/transfer_remote_files.feature
@@ -1,3 +1,4 @@
+@provider @remote_file
Feature: Transfer Remote Files
In order to easily manage many systems at once
As a Developer
View
6 features/steps/node_steps.rb
@@ -33,6 +33,12 @@
client.save_node
end
+Given /^it includes the role '(.+)'$/ do |recipe|
+ self.recipe = recipe
+ client.node.recipes << recipe
+ client.save_node
+end
+
###
# When
###
View
2 features/steps/run_client_steps.rb
@@ -45,7 +45,7 @@
cid = fork {
sleep run_for.to_i
client_pid = `ps ax | grep chef-client | grep -v grep | grep -v rake | grep -v cucumber | awk '{ print $1 }'`
- Process.kill("KILL", client_pid.to_i)
+ Process.kill("INT", client_pid.to_i)
}
When 'I run the chef-client'
Process.waitpid2(cid)
View
2 features/support/env.rb
@@ -102,5 +102,7 @@ def stash
cj.keys.each do |key|
cj.delete(key)
end
+ data_tmp = File.join(File.dirname(__FILE__), "..", "data", "tmp")
+ system("rm -rf #{data_tmp}/*")
end

0 comments on commit d402fb9

Please sign in to comment.
Something went wrong with that request. Please try again.