lib/knife/changelog/policyfile.rb in knife-changelog-1.2.1 vs lib/knife/changelog/policyfile.rb in knife-changelog-1.2.2
- old
+ new
@@ -56,10 +56,14 @@
def versions(locks, type)
raise 'Use "current" or "target" as type' unless %w[current target].include?(type)
raise 'Cookbook locks empty or nil' if locks.nil? or locks.empty?
cookbooks = {}
locks.each do |name, data|
- cookbooks[name] = { "#{type}_version" => data['version'] }
+ cookbooks[name] = if data['source_options'].keys.include?('git')
+ { "#{type}_version" => data['source_options']['revision'] }
+ else
+ { "#{type}_version" => data['version'] }
+ end
end
cookbooks
end
# Extracts Git source URL from cookbook 'source_options' data depending