Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/chef/knife/inventory_chef_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def search_args
rows: max_results,
filter_result: {
name: ["name"],
chef_version: %w[chef_packages chef version],
chef_version: %w(chef_packages chef version),
ohai_time: ["ohai_time"]
}
}
Expand Down
12 changes: 10 additions & 2 deletions lib/chef/knife/inventory_cookbook.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,16 @@ def run
@cookbook_version = name_args[1]
@show_env_constraints = config[:env_constraints]

unless @cookbook_name
ui.error "You need to specify a cookbook"
if @cookbook_name
cookbook_object = search_nodes("cookbooks_#{@cookbook_name}:*")
if cookbook_object.to_s == "[]"
ui.fatal "The cookbook name you provided #{cookbook_name} does not exist on the Chef server."
show_usage
exit 1
end
else
ui.fatal "You did not specify a cookbook. You need to specify a cookbook."
show_usage
exit 1
end

Expand Down
6 changes: 3 additions & 3 deletions tasks/changelog.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ begin
GitHubChangelogGenerator::RakeTask.new :changelog do |config|
config.future_release = "v#{Knife::ChefInventory::VERSION}"
config.issues = false
config.enhancement_labels = %w[enhancement]
config.bug_labels = %w[bug]
config.exclude_labels = %w[no_changelog]
config.enhancement_labels = %w(enhancement)
config.bug_labels = %w(bug)
config.exclude_labels = %w(no_changelog)
end
rescue LoadError
puts "Problem loading gems please install chef and github_changelog_generator"
Expand Down