)]}'
{"glanceclient/v1/images.py":[{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"8690e63a10d6faab78f6ca03241ea70de4a74999","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    pass"},{"line_number":107,"context_line":"        return meta"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get(self, image, send_req_id\u003dFalse):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BAa4%3D","line":109,"updated":"2014-01-31 02:22:44.000000000","message":"My first impression is that this is pretty ugly. But I don\u0027t have any better suggestions given we presumably need to keep backwards compatibility for the glanceclient api. I do think it should be renamed return_req_id though.\n\nOne potential alternative would be something like:\n\ndef get(self, image return_req_id\u003dNone):\n\nand then pass in an empty list object which can be updated with the request id\nif return_req_id is a list object, otherwise do nothing. This preserves what is returned in\nall cases. I think it might lead to cleaner code from the using point of view, but from this side its also very ugly and people may think this is even worse :-)","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"50cde51d3544942d2f293e2c91e1d0e3b05a50e2","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    pass"},{"line_number":107,"context_line":"        return meta"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get(self, image, send_req_id\u003dFalse):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9%2F3Q%3D","line":109,"in_reply_to":"AAAAUH%2F%2BAa4%3D","updated":"2014-01-31 06:14:37.000000000","message":"Mucking with the return type (sometimes it\u0027s an Image, sometimes it\u0027s a tuple) is still probably worse. So I think your suggestion is an improvement.\n\nIdeally I think, the return types for these functions should be an object (of a class called ImageResponse or something) that contains the Image. Then adding extras like req_id wouldn\u0027t require touching the parameter list or the return type.","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":4601,"name":"Tiago Mello","email":"tmello@linux.vnet.ibm.com","username":"tmello"},"change_message_id":"0febc74ef8509a56df60b7e27f9abe7c81bb1036","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    pass"},{"line_number":107,"context_line":"        return meta"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get(self, image, send_req_id\u003dFalse):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9t50%3D","line":109,"in_reply_to":"AAAAUH%2F9%2F3Q%3D","updated":"2014-02-04 18:10:44.000000000","message":"I liked this idea (return the object instead). Actually, Keystone does have a Resource class which can be tenant, user, etc... Resource class is a base class. We can use the same idea and add the attribute to the class. Maybe \u0027response_header\u0027 or something else...","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"ee3454fac2447b4c2ffd32cb0f6c29ef9d8a4385","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    pass"},{"line_number":107,"context_line":"        return meta"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get(self, image, send_req_id\u003dFalse):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9suQ%3D","line":109,"in_reply_to":"AAAAUH%2F9t4A%3D","updated":"2014-02-04 21:12:30.000000000","message":"This is probably something that should be suggested for glance\u0027s v2 or (rumored) v3 interface","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":4601,"name":"Tiago Mello","email":"tmello@linux.vnet.ibm.com","username":"tmello"},"change_message_id":"ff0ac97318663c35d7151d043b69a954996a7717","unresolved":false,"context_lines":[{"line_number":106,"context_line":"                    pass"},{"line_number":107,"context_line":"        return meta"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def get(self, image, send_req_id\u003dFalse):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9t4A%3D","line":109,"in_reply_to":"AAAAUH%2F9t50%3D","updated":"2014-02-04 18:15:20.000000000","message":"In fact, I do think the client should return the \u0027return code\u0027... which could be another parameter. So, the ImageResponse could wrap the Image objects plus the useful response attributes.","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":5292,"name":"Christopher Yeoh","email":"cbkyeoh@gmail.com","username":"cyeoh-0"},"change_message_id":"8690e63a10d6faab78f6ca03241ea70de4a74999","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                          % parse.quote(str(image_id)))"},{"line_number":119,"context_line":"        meta \u003d self._image_meta_from_headers(dict(resp.getheaders()))"},{"line_number":120,"context_line":"        if send_req_id:"},{"line_number":121,"context_line":"            return (Image(self, meta), resp.getheader(OS_REQ_ID_HDR, \"none\"))"},{"line_number":122,"context_line":"        else:"},{"line_number":123,"context_line":"            return Image(self, meta)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BAaw%3D","line":121,"updated":"2014-01-31 02:22:44.000000000","message":"I think it would be much better to return None (NoneType) rather than a magic string as it is less ambiguous. The user should have to look after any conversion for printing to logs. (same comment for other \"none\" uses.","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"50cde51d3544942d2f293e2c91e1d0e3b05a50e2","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                          % parse.quote(str(image_id)))"},{"line_number":119,"context_line":"        meta \u003d self._image_meta_from_headers(dict(resp.getheaders()))"},{"line_number":120,"context_line":"        if send_req_id:"},{"line_number":121,"context_line":"            return (Image(self, meta), resp.getheader(OS_REQ_ID_HDR, \"none\"))"},{"line_number":122,"context_line":"        else:"},{"line_number":123,"context_line":"            return Image(self, meta)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9%2F2w%3D","line":121,"in_reply_to":"AAAAUH%2F%2BAaw%3D","updated":"2014-01-31 06:14:37.000000000","message":"Absolutely.","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"ee3454fac2447b4c2ffd32cb0f6c29ef9d8a4385","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                                          % parse.quote(str(image_id)))"},{"line_number":119,"context_line":"        meta \u003d self._image_meta_from_headers(dict(resp.getheaders()))"},{"line_number":120,"context_line":"        if send_req_id:"},{"line_number":121,"context_line":"            return (Image(self, meta), resp.getheader(OS_REQ_ID_HDR, \"none\"))"},{"line_number":122,"context_line":"        else:"},{"line_number":123,"context_line":"            return Image(self, meta)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F9st4%3D","line":121,"in_reply_to":"AAAAUH%2F%2BAaw%3D","updated":"2014-02-04 21:12:30.000000000","message":"Done","commit_id":"548fa167f7fe9e9d240e688e06b5597282f750ef"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"682e9018bc18982680d1286d044936818219b1e8","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        resp, body \u003d self.api.raw_request(\u0027HEAD\u0027, \u0027/v1/images/%s\u0027"},{"line_number":118,"context_line":"                                          % parse.quote(str(image_id)))"},{"line_number":119,"context_line":"        meta \u003d self._image_meta_from_headers(dict(resp.getheaders()))"},{"line_number":120,"context_line":"        if isinstance(kwargs.get(\u0027return_req_id\u0027), list):"},{"line_number":121,"context_line":"            kwargs[\u0027return_req_id\u0027].append(resp.getheader(OS_REQ_ID_HDR, None))"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return Image(self, meta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9mNU%3D","line":120,"updated":"2014-02-05 19:42:25.000000000","message":"I think the only key requirement here is that the value of return_req_id has a method \"append\". So let\u0027s just try to append to it if its present.\n\n  return_request_ids \u003d kwargs.get(\u0027return_req_id\u0027, None)\n  if return_request_ids is not None:\n      request_id \u003d resp.getheader(OS_REQ_ID_HDR, None)\n      if request_id is not None:\n          return_request_ids.append(request_id)\n\nThis comment applies throughout the changes here where you are checking \"isinstance(..., list)\"","commit_id":"903112648d90deb5f532ab53206e8fb18312182f"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"fae5ac44154c4d70d71dc684bcacb0081637b988","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        resp, body \u003d self.api.raw_request(\u0027HEAD\u0027, \u0027/v1/images/%s\u0027"},{"line_number":118,"context_line":"                                          % parse.quote(str(image_id)))"},{"line_number":119,"context_line":"        meta \u003d self._image_meta_from_headers(dict(resp.getheaders()))"},{"line_number":120,"context_line":"        if isinstance(kwargs.get(\u0027return_req_id\u0027), list):"},{"line_number":121,"context_line":"            kwargs[\u0027return_req_id\u0027].append(resp.getheader(OS_REQ_ID_HDR, None))"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"        return Image(self, meta)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9jM0%3D","line":120,"in_reply_to":"AAAAUH%2F9mNU%3D","updated":"2014-02-06 04:49:05.000000000","message":"Done","commit_id":"903112648d90deb5f532ab53206e8fb18312182f"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"682e9018bc18982680d1286d044936818219b1e8","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        absolute_limit \u003d kwargs.get(\u0027limit\u0027)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        def paginate(qp, seen\u003d0, return_req_id\u003dFalse):"},{"line_number":164,"context_line":"            def filter_owner(owner, image):"},{"line_number":165,"context_line":"                # If client side owner \u0027filter\u0027 is specified"},{"line_number":166,"context_line":"                # only return images that match \u0027owner\u0027."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9mFE%3D","line":163,"updated":"2014-02-05 19:42:25.000000000","message":"can we just pass the return_req_id list object into paginate, rather than modifying what paginate returns/yields?","commit_id":"903112648d90deb5f532ab53206e8fb18312182f"},{"author":{"_account_id":9126,"name":"Chris Buccella","email":"chris@buccella.org","username":"hdd"},"change_message_id":"fae5ac44154c4d70d71dc684bcacb0081637b988","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        \"\"\""},{"line_number":161,"context_line":"        absolute_limit \u003d kwargs.get(\u0027limit\u0027)"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"        def paginate(qp, seen\u003d0, return_req_id\u003dFalse):"},{"line_number":164,"context_line":"            def filter_owner(owner, image):"},{"line_number":165,"context_line":"                # If client side owner \u0027filter\u0027 is specified"},{"line_number":166,"context_line":"                # only return images that match \u0027owner\u0027."}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9jMw%3D","line":163,"in_reply_to":"AAAAUH%2F9mFE%3D","updated":"2014-02-06 04:49:05.000000000","message":"Done","commit_id":"903112648d90deb5f532ab53206e8fb18312182f"},{"author":{"_account_id":616,"name":"Mark Washenberger","email":"mark.washenberger@markwash.net","username":"markwash"},"change_message_id":"682e9018bc18982680d1286d044936818219b1e8","unresolved":false,"context_lines":[{"line_number":189,"context_line":""},{"line_number":190,"context_line":"            #Note(hdd) The first returned object may be the request id"},{"line_number":191,"context_line":"            if return_req_id:"},{"line_number":192,"context_line":"                yield resp.getheader(OS_REQ_ID_HDR, None)"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"            for image in images:"},{"line_number":195,"context_line":"                if filter_owner(owner, image):"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F9mEk%3D","line":192,"updated":"2014-02-05 19:42:25.000000000","message":"See note above, I\u0027m a bit leery of yielding two different types of items from this generator.","commit_id":"903112648d90deb5f532ab53206e8fb18312182f"},{"author":{"_account_id":4601,"name":"Tiago Mello","email":"tmello@linux.vnet.ibm.com","username":"tmello"},"change_message_id":"a0fb3c38c3913c1cf5929d9fc72c04ce302eb945","unresolved":false,"context_lines":[{"line_number":109,"context_line":"    def get(self, image, **kwargs):"},{"line_number":110,"context_line":"        \"\"\"Get the metadata for a specific image."},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        :param image: image object or id to look up"},{"line_number":113,"context_line":"        :rtype: :class:`Image`"},{"line_number":114,"context_line":"        \"\"\""},{"line_number":115,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAU3%2F%2F0Og%3D","line":112,"updated":"2014-02-24 16:56:32.000000000","message":"I think this method also needs documentation just like the list method.","commit_id":"358a5502448d119b32349db717a4c77523c94f2b"}]}
