Skip to content

Commit 2580139

Browse files
Thom MaySeth Falcon
authored andcommitted
Ensure the list of versions is sorted
Satisfy "latest" correctly, so we can use this everywhere
1 parent 48e7e0f commit 2580139

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

chef-server-api/app/controllers/nodes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ def cookbooks
105105

106106
def satisfy(cookbook, req=nil)
107107
r = req.to_s
108-
versions = Chef::CookbookVersion.cdb_by_name(cookbook_name)
109-
if r.nil? or r.empty?
108+
versions = Chef::CookbookVersion.cdb_by_name(cookbook)[cookbook].sort
109+
if r.nil? or r.empty? or r == "latest"
110110
versions
111111
elsif r =~ PATTERN
112112
comp = $1 || "="

0 commit comments

Comments
 (0)