Skip to content

Commit

Permalink
knife CSD version must be accessible to knife CSI
Browse files Browse the repository at this point in the history
  • Loading branch information
btm committed Apr 5, 2012
1 parent 474cee4 commit b7e46f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 4 additions & 5 deletions chef/lib/chef/knife/cookbook_site_download.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def run
download_cookbook
end

def version
@version = desired_cookbook_data['version']
end

private
def cookbooks_api_url
'http://cookbooks.opscode.com/api/v1/cookbooks'
Expand Down Expand Up @@ -100,11 +104,6 @@ def replacement_cookbook
def specific_cookbook_version_url
"#{cookbooks_api_url}/#{@name_args[0]}/versions/#{@name_args[1].gsub('.', '_')}"
end

def version
@version = desired_cookbook_data['version']
end

end
end
end
5 changes: 5 additions & 0 deletions chef/spec/unit/knife/cookbook_site_download_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@
end
end

it 'should provide an accessor to the version' do
FileUtils.stub(:cp).and_return(true)
@knife.version.should == @version
@knife.run
end
end

context 'downloading a cookbook of a specific version' do
Expand Down

0 comments on commit b7e46f0

Please sign in to comment.