Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Update Chef dependency to Chef 11
Browse files Browse the repository at this point in the history
Also add dependency on json <= 1.7.7, required by Chef 11.

Resolves problem: Bundler could not find compatible versions for gem
"json" (required for chef and berkshelf).

Partial fix for bug #1183540

Change-Id: I97ab10e492fa4799fb4e7ce81ff500621d0aa2fb
  • Loading branch information
torandu committed Jun 10, 2013
1 parent 4b56905 commit 7bf4d01
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

This file is used to list changes made in each version of cookbook-openstack-common.

## 0.2.6:
* Update Chef dependency to Chef 11

## 0.2.5:
* Moved the default library to database, to better represent its duties

Expand Down
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
source "https://rubygems.org"

gem "chef", "~> 10.18.2"
gem "chef", "~> 11.4.4"
gem "json", "<= 1.7.7" # chef 11 dependency
gem "berkshelf", "~> 1.4.0"
gem "chefspec", "~> 1.2.0"
gem "foodcritic", "~> 2.1.0"
31 changes: 13 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,21 @@ GEM
thor (~> 0.18.0)
yajl-ruby
builder (3.2.2)
bunny (0.7.9)
celluloid (0.14.1)
timers (>= 1.0.0)
chef (10.18.2)
bunny (>= 0.6.0, < 0.8.0)
chef (11.4.4)
erubis
highline (>= 1.6.9)
json (>= 1.4.4, <= 1.6.1)
json (>= 1.4.4, <= 1.7.7)
mixlib-authentication (>= 1.3.0)
mixlib-cli (>= 1.1.0)
mixlib-cli (~> 1.3.0)
mixlib-config (>= 1.1.2)
mixlib-log (>= 1.3.0)
mixlib-shellout
moneta (< 0.7.0)
net-ssh (~> 2.2.2)
net-ssh (~> 2.6)
net-ssh-multi (~> 1.1.0)
ohai (>= 0.6.0)
rest-client (>= 1.0.4, < 1.7.0)
treetop (~> 1.4.9)
uuidtools
yajl-ruby (~> 1.1)
chefspec (1.2.0)
chef (>= 10.0)
Expand Down Expand Up @@ -91,7 +86,7 @@ GEM
rack
i18n (0.6.1)
ipaddress (0.8.0)
json (1.6.1)
json (1.7.7)
little-plugger (1.1.3)
logging (1.6.2)
little-plugger (>= 1.1.3)
Expand All @@ -108,14 +103,13 @@ GEM
mixlib-config (1.1.2)
mixlib-log (1.6.0)
mixlib-shellout (1.1.0)
moneta (0.6.0)
multi_json (1.7.5)
multi_xml (0.5.3)
multi_json (1.7.6)
multi_xml (0.5.4)
multipart-post (1.2.0)
net-http-persistent (2.8)
net-ssh (2.2.2)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
net-ssh (2.6.7)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
net-ssh-multi (1.1)
net-ssh (>= 2.1.4)
net-ssh-gateway (>= 0.99.0)
Expand Down Expand Up @@ -173,7 +167,7 @@ GEM
systemu (2.5.2)
thor (0.18.1)
timers (1.1.0)
treetop (1.4.12)
treetop (1.4.14)
polyglot
polyglot (>= 0.3.1)
uuidtools (2.1.4)
Expand All @@ -194,6 +188,7 @@ PLATFORMS

DEPENDENCIES
berkshelf (~> 1.4.0)
chef (~> 10.18.2)
chef (~> 11.4.4)
chefspec (~> 1.2.0)
foodcritic (~> 2.1.0)
json (<= 1.7.7)
2 changes: 1 addition & 1 deletion libraries/roles.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module ::Openstack
# If no node is found having the supplied role, nil is
# returned.
def config_by_role role, section=nil
if node['roles'].include?(role)
if node.run_list.roles.include?(role)
# If we're on a node that contains the searched-for role, just
# return the node hash or subsection
section.nil? ? node : node[section]
Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
license "Apache 2.0"
description "Common OpenStack attributes, libraries and recipes."
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version "0.2.4"
version "0.2.6"

recipe "openstack-common", "Installs/Configures common recipes"
recipe "openstack-common::logging", "Installs/Configures common logging"
Expand Down
7 changes: 4 additions & 3 deletions spec/roles_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,25 @@
describe "#config_by_role" do
it "returns nil when section not in node hash" do
node = @chef_run.node
node['roles'] << "role1"
node.run_list << "role[role1]"
@subject.stub(:node).and_return node
@subject.config_by_role("role1", "foo").should be_nil
end
it "returns section when section in node hash" do
::Chef::Search::Query.stub(:new)
node = @chef_run.node
node['roles'] << "role1"
node.run_list << "role[role1]"
node.set['foo'] = "bar"
@subject.stub(:node).and_return node

@subject.config_by_role("role1", "foo").should == "bar"
end
it "returns nil when no such role found" do
::Chef::Search::Query.stub(:new).with(:search).and_return(
[ [], nil, nil ]
)
node = @chef_run.node
node['roles'] << "role1"
node.run_list << "role[role1]"
@subject.stub(:node).and_return node
@subject.config_by_role("role1", "bar").should be_nil
end
Expand Down

0 comments on commit 7bf4d01

Please sign in to comment.