)]}'
{"openstack/metric/v1/metric.py":[{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"918e114835c76a5601e3d67de645812ad5a1c2cf","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"},{"line_number":40,"context_line":"                                       marker, path_args, **params)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_53cea2b5","line":37,"updated":"2015-02-15 03:15:27.000000000","message":"Is there an issue if a marker is sent? When allow_list is set, users can call Metric.list and receive a generator of pages of metrics, and the base Resource.list implementation will store the name of the last item on a page and send it as the marker in the next request. Right now that would make it so only one page can be received.\n\nOr does this /metric resource support pagination? If it doesn\u0027t and we just expect to be able to get a one page list we should remove allow_list (default is False, or set explicitly to False if you prefer). Additionally, if a marker param is going to be an issue we should raise some exception instead of returning an empty list.\n\n\nIf there\u0027s nothing actually wrong with sending a marker, even if marker is just ignored by the server, I think this page override should probably just be removed.","commit_id":"63db78c7410f0b1337724a8359f010d9deac28ac"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"47fc5db95ddf22a39f921119f84eb9032ebfca9d","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"},{"line_number":40,"context_line":"                                       marker, path_args, **params)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_b0e7b9ab","line":37,"in_reply_to":"da86d52c_53cea2b5","updated":"2015-02-16 13:54:26.000000000","message":"The server does not support pagination, but adding a limit or a marker does not raise any issue.\n\nYou\u0027re right, there seems to be no need of that override. Removing it!","commit_id":"63db78c7410f0b1337724a8359f010d9deac28ac"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"cb703545340d5fbbe0c2f1a25aa1e7b031a2413f","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"},{"line_number":40,"context_line":"                                       marker, path_args, **params)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_c5d464bd","line":37,"in_reply_to":"da86d52c_b0e7b9ab","updated":"2015-02-16 16:53:17.000000000","message":"Actually that\u0027s wrong – this is needed.\n\nThe problem is that if there\u0027s at least one metric, it will fail: list() will cal page(), which will return [the_metric]. Then it will call page() again with marker\u003dthe_metric… which will return [the_metric] again since it does not care about marker… and this will never stop.","commit_id":"63db78c7410f0b1337724a8359f010d9deac28ac"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"f32da3a4c79401dcee163cfe8a9d1802b5a75dfe","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"},{"line_number":40,"context_line":"                                       marker, path_args, **params)"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_53811efa","line":37,"in_reply_to":"da86d52c_c5d464bd","updated":"2015-02-16 17:46:51.000000000","message":"That\u0027s where https://review.openstack.org/#/c/156007/ comes in. If GET returns one page of data like yours does, the base Resource.page is correct. If GET is paginated, Resource.list will make multiple calls to Resource.page. We tried making Resource.list work for both cases but it penalizes both use cases because we have to figure out if we\u0027re either in an infinite loop by comparing the previous response to the current one (which is the case you just said), or we have to make extra HTTP calls to figure out if we should keep paging.\n\nHowever, implementation details like that are smoothed over in the higher-level Connection interface that users will be more likely to use. We would then have something like...\n\n    conn \u003d connection.Connection(...auth args...)\n    for metric in conn.metric.metrics(): # This method would iterate over Metric.page\n        print(metric.archive_policy_name)\n\nI am going to add some of this info to http://python-openstacksdk.readthedocs.org/en/latest/contributors/create/resource.html as well as expand it to cover creating the higher-level interfaces. You just came in before we had some of this explained, so I apologize that this isn\u0027t entirely clear at the moment.\n\nPatchset 6 was the correct way.","commit_id":"63db78c7410f0b1337724a8359f010d9deac28ac"},{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"6b349c8fbc32ba002a860e6ab1ccb46a4c8b5ad7","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    name \u003d resource.prop(\u0027name\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_c4358147","line":36,"updated":"2015-02-20 13:56:00.000000000","message":"Get rid of this method, the problem will be solved by https://bugs.launchpad.net/python-openstacksdk/+bug/1410980","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7cc950233dcf592435864ba7a5df1966775560fa","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    name \u003d resource.prop(\u0027name\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_a874829c","line":36,"in_reply_to":"ba7be1f8_9f8659b8","updated":"2015-03-02 17:21:54.000000000","message":"Done","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"},{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"303a622de22d763218761f325d7335a69f1cf4c9","unresolved":false,"context_lines":[{"line_number":33,"context_line":"    name \u003d resource.prop(\u0027name\u0027)"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    @classmethod"},{"line_number":36,"context_line":"    def page(cls, session, limit, marker\u003dNone, path_args\u003dNone, **params):"},{"line_number":37,"context_line":"        if marker:"},{"line_number":38,"context_line":"            return []"},{"line_number":39,"context_line":"        return super(Metric, cls).page(session, limit,"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_9f8659b8","line":36,"in_reply_to":"ba7be1f8_c4358147","updated":"2015-02-21 01:00:37.000000000","message":"patchset 6 + https://review.openstack.org/#/c/156664/ will give him the proper behavior with paginate\u003dFalse. Prior to that review, ps6 + https://review.openstack.org/#/c/156007/ would do the trick, but we don\u0027t really want that change anymore as far as I know.","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"}],"openstack/tests/metric/v1/test_metric.py":[{"author":{"_account_id":8257,"name":"Brian Curtin","email":"brian@python.org","username":"briancurtin"},"change_message_id":"918e114835c76a5601e3d67de645812ad5a1c2cf","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from openstack.metric.v1 import metric"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"EXAMPLE \u003d {"},{"line_number":19,"context_line":"    \u0027id\u0027: \u002731bbd62e-b144-11e4-983c-bf9dbe7e25e6\u0027,"},{"line_number":20,"context_line":"    \u0027archive_policy_name\u0027: \u0027low\u0027,"},{"line_number":21,"context_line":"}"}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_133b4a9d","line":18,"updated":"2015-02-15 03:15:27.000000000","message":"Ideally the example response bodies should include each of the properties on the resource so we\u0027re sure everything is hooked up correctly.","commit_id":"63db78c7410f0b1337724a8359f010d9deac28ac"},{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"6b349c8fbc32ba002a860e6ab1ccb46a4c8b5ad7","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"EXAMPLE \u003d {"},{"line_number":19,"context_line":"    \u0027id\u0027: \u002731bbd62e-b144-11e4-983c-bf9dbe7e25e6\u0027,"},{"line_number":20,"context_line":"    \u0027archive_policy_name\u0027: \u0027low\u0027,"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_c45ae182","line":20,"updated":"2015-02-20 13:56:00.000000000","message":"This example is lacking the other properties.","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7cc950233dcf592435864ba7a5df1966775560fa","unresolved":false,"context_lines":[{"line_number":17,"context_line":""},{"line_number":18,"context_line":"EXAMPLE \u003d {"},{"line_number":19,"context_line":"    \u0027id\u0027: \u002731bbd62e-b144-11e4-983c-bf9dbe7e25e6\u0027,"},{"line_number":20,"context_line":"    \u0027archive_policy_name\u0027: \u0027low\u0027,"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_885dfe17","line":20,"in_reply_to":"ba7be1f8_c45ae182","updated":"2015-03-02 17:21:54.000000000","message":"Done","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"},{"author":{"_account_id":8736,"name":"Terry Howe","email":"terrylhowe@gmail.com","username":"terrylhowe"},"change_message_id":"6b349c8fbc32ba002a860e6ab1ccb46a4c8b5ad7","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def test_make_it(self):"},{"line_number":47,"context_line":"        m \u003d metric.Metric(EXAMPLE)"},{"line_number":48,"context_line":"        self.assertEqual(EXAMPLE[\u0027id\u0027], m.id)"},{"line_number":49,"context_line":"        self.assertEqual(EXAMPLE[\u0027archive_policy_name\u0027], m.archive_policy_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_644bf5b0","line":49,"updated":"2015-02-20 13:56:00.000000000","message":"This test should cover the other properties.","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7cc950233dcf592435864ba7a5df1966775560fa","unresolved":false,"context_lines":[{"line_number":46,"context_line":"    def test_make_it(self):"},{"line_number":47,"context_line":"        m \u003d metric.Metric(EXAMPLE)"},{"line_number":48,"context_line":"        self.assertEqual(EXAMPLE[\u0027id\u0027], m.id)"},{"line_number":49,"context_line":"        self.assertEqual(EXAMPLE[\u0027archive_policy_name\u0027], m.archive_policy_name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba7be1f8_a89ba2c7","line":49,"in_reply_to":"ba7be1f8_644bf5b0","updated":"2015-03-02 17:21:54.000000000","message":"Done","commit_id":"a378b29e4c381c1477c28ef14bdffeebee82490d"}]}
