- From: Adam Jacob <
>
- To:
- Subject: [[chef-dev]] Search syntax change in 0.8 alpha
- Date: Tue, 01 Dec 2009 20:22:56 -0800
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
For those of you using the 0.8 alpha, we just committed a change that
will break certain uses of search within recipes. Previously, we
assumed that if you did not pass a block to search, you wanted manual
iteration of the result set. In hindsight, that was silly. So if you
had code that did this:
results, start, total = search(:nodes, "*:*")
results.each do |node|
# Do some stuff
end
You must change it to this:
results = search(:nodes, "*:*")
Which will give you the same results, only the entire matching result set.
If you still want manual iteration, you need to specify the starting
position:
results, start, total = search(:nodes, "*:*", nil, 0, 10)
(nil is the sort order, 0 is the starting position, 10 is the number of
results to fetch at a time)
You'll want to update your recipes before you install a new Chef 0.8 gem
from HEAD.
Regards,
Adam
- --
Opscode, Inc.
Adam Jacob, CTO
T: (206) 508-7449 E:
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)
Comment: Using GnuPG with Mozilla -
http://enigmail.mozdev.org/
iQEcBAEBAgAGBQJLFeugAAoJEK+ksDjf4JoC9J8H/38jX8wuQYbXb6rac6Hf5IuW
jrQrCBu5j2BS79MTHyJi1dA/myKlA9bct+/mvDmEJyLsNNyYDdxZeWyLTbr3vOUB
e+4J7LNbtBY7827SfJ9VUCutPpmlyK8fGzX9MXSq0CeqLsXpq0bldMaQbOVEsTBy
gWoLIx+fz2PGo9VMc2qz2SC2QJsqU5t4tnCj034UG90Ds+9b/Qm2sOTGw8We0mv2
XnUj5vSaqkdzX1VumVapP3C9/k6aRBfbBbHHdRAFefiVyoncJiMwov8VIX5fOgIe
Ay7swJCEFzpjO5CbrOP4AQ2zOpPd9D+nuqul0BP/QEgSqbnbJ4NHUbNvHVSCS8A=
=w4M2
-----END PGP SIGNATURE-----
- [[chef-dev]] Search syntax change in 0.8 alpha, Adam Jacob, 12/01/2009
Archive powered by MHonArc 2.6.16.