)]}'
{"openstack/resource.py":[{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"bac33c18c6d21d65d1973c7170c915ae23718b81","unresolved":false,"context_lines":[{"line_number":937,"context_line":""},{"line_number":938,"context_line":"        :return: A generator of :class:`Resource` objects matching the query."},{"line_number":939,"context_line":"                 If nothing matches, an empty generator is returned."},{"line_number":940,"context_line":"        \"\"\""},{"line_number":941,"context_line":"        for attr, pattern in query.items():"},{"line_number":942,"context_line":"            query[attr] \u003d re.compile(pattern)"},{"line_number":943,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_8d5fe974","line":940,"updated":"2015-06-19 23:10:12.000000000","message":"I was kind of hoping it was going to act similar how it did before \u0027if not query\u0027.","commit_id":"5098dcfbd0d7d0e917ac9bf8803c11fd3b84cb78"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"18cedea148b14aecb2179a5946e7b59fbb815ee7","unresolved":false,"context_lines":[{"line_number":937,"context_line":""},{"line_number":938,"context_line":"        :return: A generator of :class:`Resource` objects matching the query."},{"line_number":939,"context_line":"                 If nothing matches, an empty generator is returned."},{"line_number":940,"context_line":"        \"\"\""},{"line_number":941,"context_line":"        for attr, pattern in query.items():"},{"line_number":942,"context_line":"            query[attr] \u003d re.compile(pattern)"},{"line_number":943,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa32b979_adc286e7","line":940,"in_reply_to":"fa32b979_8d5fe974","updated":"2015-06-23 16:03:02.000000000","message":"For one, the ability to find more than just by name or id seems very useful. While compute.servers() has the benefit of being able to pass in image and flavor queries, most other things don\u0027t, so this find method would bring that to a lot of other places where searching for something in the configuration of a resource makes sense.\n\nThe magic of attempting to find a value in two different ways is actually something we never should have done. If we want to keep any semblance of that behavior, we could add an optional argument here that we pass to Resource.from_id and then only make one request, but I think that\u0027ll break this API because then we get into the confusion of raising exceptions, returning a single value, or returning a generator. Given that this works off of list and the fact that it works with queries that can return multiple values, it should be returning a generator.\n\nAdditionally, the behavior this find gives is actually covered in the get_ proxy methods, e.g., get_server...sort of. If we really want to keep what the old find was attempting, I would rather support a change to make get_* proxy methods try not only ids but also names.","commit_id":"5098dcfbd0d7d0e917ac9bf8803c11fd3b84cb78"}]}
