)]}'
{"blazar/manager/service.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":299,"context_line":"    @statuses.lease.manage_status(statuses.lease.UPDATING)"},{"line_number":300,"context_line":"    def update_lease(self, lease_id, values):"},{"line_number":301,"context_line":"        if not values:"},{"line_number":302,"context_line":"            lease \u003d db_api.lease_get(lease_id)"},{"line_number":303,"context_line":"            lease[\u0027status\u0027] \u003d statuses.lease.guess_stable_status(lease_id)"},{"line_number":304,"context_line":"            return lease"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        if len(values) \u003d\u003d 1 and \u0027name\u0027 in values:"},{"line_number":307,"context_line":"            db_api.lease_update(lease_id, values)"},{"line_number":308,"context_line":"            lease \u003d db_api.lease_get(lease_id)"},{"line_number":309,"context_line":"            lease[\u0027status\u0027] \u003d statuses.lease.guess_stable_status(lease_id)"},{"line_number":310,"context_line":"            return lease"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        lease \u003d db_api.lease_get(lease_id)"},{"line_number":313,"context_line":"        start_date \u003d values.get("}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_e2465b50","line":310,"range":{"start_line":302,"start_character":0,"end_line":310,"end_character":24},"updated":"2017-11-20 11:52:53.000000000","message":"please see my comment for manage_status() or COMBINATION at statuses.py.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":299,"context_line":"    @statuses.lease.manage_status(statuses.lease.UPDATING)"},{"line_number":300,"context_line":"    def update_lease(self, lease_id, values):"},{"line_number":301,"context_line":"        if not values:"},{"line_number":302,"context_line":"            lease \u003d db_api.lease_get(lease_id)"},{"line_number":303,"context_line":"            lease[\u0027status\u0027] \u003d statuses.lease.guess_stable_status(lease_id)"},{"line_number":304,"context_line":"            return lease"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        if len(values) \u003d\u003d 1 and \u0027name\u0027 in values:"},{"line_number":307,"context_line":"            db_api.lease_update(lease_id, values)"},{"line_number":308,"context_line":"            lease \u003d db_api.lease_get(lease_id)"},{"line_number":309,"context_line":"            lease[\u0027status\u0027] \u003d statuses.lease.guess_stable_status(lease_id)"},{"line_number":310,"context_line":"            return lease"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"        lease \u003d db_api.lease_get(lease_id)"},{"line_number":313,"context_line":"        start_date \u003d values.get("}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_2e6ab7b2","line":310,"range":{"start_line":302,"start_character":0,"end_line":310,"end_character":24},"in_reply_to":"ff82abbf_e2465b50","updated":"2017-11-22 05:17:02.000000000","message":"Please see my reply to that comment.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                }"},{"line_number":452,"context_line":"            )"},{"line_number":453,"context_line":"            if not start_event:"},{"line_number":454,"context_line":"                raise common_ex.BlazarException(\u0027Event not found\u0027)"},{"line_number":455,"context_line":"            end_event \u003d db_api.event_get_first_sorted_by_filters("},{"line_number":456,"context_line":"                \u0027lease_id\u0027,"},{"line_number":457,"context_line":"                \u0027asc\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_5cbb1a71","line":454,"range":{"start_line":454,"start_character":49,"end_line":454,"end_character":64},"updated":"2018-01-04 18:55:14.000000000","message":"Can you please make the error message more specific, for example:\n\n    start_lease event for lease \u003clease_id\u003e not found\n\nThis will make it easier to debug for an operator.","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":451,"context_line":"                }"},{"line_number":452,"context_line":"            )"},{"line_number":453,"context_line":"            if not start_event:"},{"line_number":454,"context_line":"                raise common_ex.BlazarException(\u0027Event not found\u0027)"},{"line_number":455,"context_line":"            end_event \u003d db_api.event_get_first_sorted_by_filters("},{"line_number":456,"context_line":"                \u0027lease_id\u0027,"},{"line_number":457,"context_line":"                \u0027asc\u0027,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_ed71d077","line":454,"range":{"start_line":454,"start_character":49,"end_line":454,"end_character":64},"in_reply_to":"9f91af0f_5cbb1a71","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":462,"context_line":"                }"},{"line_number":463,"context_line":"            )"},{"line_number":464,"context_line":"            if not end_event:"},{"line_number":465,"context_line":"                raise common_ex.BlazarException(\u0027Event not found\u0027)"},{"line_number":466,"context_line":"            db_api.event_update(end_event[\u0027id\u0027],"},{"line_number":467,"context_line":"                                {\u0027status\u0027: status.event.IN_PROGRESS})"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_1cad9230","line":465,"range":{"start_line":465,"start_character":49,"end_line":465,"end_character":64},"updated":"2018-01-04 18:55:14.000000000","message":"Can you please make the error message more specific, for example:\n\n    end_lease event for lease \u003clease_id\u003e not found\n\nThis will make it easier to debug for an operator.","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":462,"context_line":"                }"},{"line_number":463,"context_line":"            )"},{"line_number":464,"context_line":"            if not end_event:"},{"line_number":465,"context_line":"                raise common_ex.BlazarException(\u0027Event not found\u0027)"},{"line_number":466,"context_line":"            db_api.event_update(end_event[\u0027id\u0027],"},{"line_number":467,"context_line":"                                {\u0027status\u0027: status.event.IN_PROGRESS})"},{"line_number":468,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_adfc28b5","line":465,"range":{"start_line":465,"start_character":49,"end_line":465,"end_character":64},"in_reply_to":"9f91af0f_1cad9230","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"}],"blazar/status.py":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    # All statuses"},{"line_number":26,"context_line":"    ALL \u003d ()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":29,"context_line":"    NEXT_STATUSES \u003d {}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_1737ade5","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":51},"updated":"2018-01-04 18:55:14.000000000","message":"I think a better description is:\n\n    Valid status transitions","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":25,"context_line":"    # All statuses"},{"line_number":26,"context_line":"    ALL \u003d ()"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":29,"context_line":"    NEXT_STATUSES \u003d {}"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_2d2a582b","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":51},"in_reply_to":"9f91af0f_1737ade5","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    ALL \u003d (UNDONE, IN_PROGRESS, DONE, ERROR)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":60,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":61,"context_line":"        UNDONE: (IN_PROGRESS,),"},{"line_number":62,"context_line":"        IN_PROGRESS: (DONE, ERROR),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_b71cc16a","line":59,"range":{"start_line":59,"start_character":4,"end_line":59,"end_character":51},"updated":"2018-01-04 18:55:14.000000000","message":"I think a better description is:\n\n    Valid status transitions","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    ALL \u003d (UNDONE, IN_PROGRESS, DONE, ERROR)"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":60,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":61,"context_line":"        UNDONE: (IN_PROGRESS,),"},{"line_number":62,"context_line":"        IN_PROGRESS: (DONE, ERROR),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_ed1f9005","line":59,"range":{"start_line":59,"start_character":4,"end_line":59,"end_character":51},"in_reply_to":"9f91af0f_b71cc16a","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    ALL \u003d (PENDING, ACTIVE, DELETED, ERROR)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":80,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":81,"context_line":"        PENDING: (ACTIVE, DELETED, ERROR),"},{"line_number":82,"context_line":"        ACTIVE: (DELETED, ERROR),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_972bbd80","line":79,"range":{"start_line":79,"start_character":4,"end_line":79,"end_character":51},"updated":"2018-01-04 18:55:14.000000000","message":"I think a better description is:\n\n    Valid status transitions","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    ALL \u003d (PENDING, ACTIVE, DELETED, ERROR)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":80,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":81,"context_line":"        PENDING: (ACTIVE, DELETED, ERROR),"},{"line_number":82,"context_line":"        ACTIVE: (DELETED, ERROR),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_ad1508e7","line":79,"range":{"start_line":79,"start_character":4,"end_line":79,"end_character":51},"in_reply_to":"9f91af0f_972bbd80","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    # All statuses"},{"line_number":109,"context_line":"    ALL \u003d STABLE + TRANSITIONAL"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":112,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":113,"context_line":"        PENDING: (STARTING, UPDATING, DELETING),"},{"line_number":114,"context_line":"        ACTIVE: (TERMINATING, UPDATING, DELETING),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_572535aa","line":111,"range":{"start_line":111,"start_character":4,"end_line":111,"end_character":51},"updated":"2018-01-04 18:55:14.000000000","message":"I think a better description is:\n\n    Valid status transitions","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":108,"context_line":"    # All statuses"},{"line_number":109,"context_line":"    ALL \u003d STABLE + TRANSITIONAL"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    # Statuses that connected with an outgoing edge"},{"line_number":112,"context_line":"    NEXT_STATUSES \u003d {"},{"line_number":113,"context_line":"        PENDING: (STARTING, UPDATING, DELETING),"},{"line_number":114,"context_line":"        ACTIVE: (TERMINATING, UPDATING, DELETING),"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_4dd47c20","line":111,"range":{"start_line":111,"start_character":4,"end_line":111,"end_character":51},"in_reply_to":"9f91af0f_572535aa","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                try:"},{"line_number":204,"context_line":"                    result \u003d func(*args, **kwargs)"},{"line_number":205,"context_line":"                except Exception as e:"},{"line_number":206,"context_line":"                    LOG.error(\u0027lease %s fell into ERROR. %s\u0027,"},{"line_number":207,"context_line":"                              lease_id, e.message)"},{"line_number":208,"context_line":"                    db_api.lease_update(lease_id,"},{"line_number":209,"context_line":"                                        {\u0027status\u0027: cls.ERROR})"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_779b99c8","line":206,"range":{"start_line":206,"start_character":31,"end_line":206,"end_character":56},"updated":"2018-01-04 18:55:14.000000000","message":"Lease %s went into ERROR status.","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                try:"},{"line_number":204,"context_line":"                    result \u003d func(*args, **kwargs)"},{"line_number":205,"context_line":"                except Exception as e:"},{"line_number":206,"context_line":"                    LOG.error(\u0027lease %s fell into ERROR. %s\u0027,"},{"line_number":207,"context_line":"                              lease_id, e.message)"},{"line_number":208,"context_line":"                    db_api.lease_update(lease_id,"},{"line_number":209,"context_line":"                                        {\u0027status\u0027: cls.ERROR})"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_0ddaf449","line":206,"range":{"start_line":206,"start_character":31,"end_line":206,"end_character":56},"in_reply_to":"9f91af0f_779b99c8","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"d837aa096cd9670e333c9728d7d73a8c7a8e269b","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                        LOG.debug(\u0027Status of lease %s changed from %s to %s.\u0027,"},{"line_number":222,"context_line":"                                  lease_id, transition, next_status)"},{"line_number":223,"context_line":"                    else:"},{"line_number":224,"context_line":"                        LOG.error(\u0027lease %s fell into ERROR.\u0027, lease_id)"},{"line_number":225,"context_line":"                        db_api.lease_update(lease_id, {\u0027status\u0027: cls.ERROR})"},{"line_number":226,"context_line":"                        raise exceptions.InvalidStatus"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_b76361dc","line":224,"range":{"start_line":224,"start_character":35,"end_line":224,"end_character":60},"updated":"2018-01-04 18:55:14.000000000","message":"Lease %s went into ERROR status.","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"bc436bfb1f54a29424d53d883b48f06834e233d4","unresolved":false,"context_lines":[{"line_number":221,"context_line":"                        LOG.debug(\u0027Status of lease %s changed from %s to %s.\u0027,"},{"line_number":222,"context_line":"                                  lease_id, transition, next_status)"},{"line_number":223,"context_line":"                    else:"},{"line_number":224,"context_line":"                        LOG.error(\u0027lease %s fell into ERROR.\u0027, lease_id)"},{"line_number":225,"context_line":"                        db_api.lease_update(lease_id, {\u0027status\u0027: cls.ERROR})"},{"line_number":226,"context_line":"                        raise exceptions.InvalidStatus"},{"line_number":227,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f91af0f_ede4700f","line":224,"range":{"start_line":224,"start_character":35,"end_line":224,"end_character":60},"in_reply_to":"9f91af0f_b76361dc","updated":"2018-01-09 05:14:49.000000000","message":"Done","commit_id":"7e9553eee482e96e7d7b47302f9422c8edd4a719"}],"blazar/statuses.py":[{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        ERROR: (UPDATING, DELETING),"},{"line_number":115,"context_line":"        CREATING: (PENDING, DELETING),"},{"line_number":116,"context_line":"        STARTING: (ACTIVE, ERROR, DELETING),"},{"line_number":117,"context_line":"        UPDATING: STABLE + (DELETING,),"},{"line_number":118,"context_line":"        TERMINATING: (TERMINATED, ERROR, DELETING),"},{"line_number":119,"context_line":"        DELETING: (ERROR,)"},{"line_number":120,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_9c181dd4","line":117,"range":{"start_line":117,"start_character":27,"end_line":117,"end_character":38},"updated":"2017-11-20 11:52:53.000000000","message":"Why \u0027DELETING\u0027 status is one of next statuses of \u0027UPDATING\u0027?","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        ERROR: (UPDATING, DELETING),"},{"line_number":115,"context_line":"        CREATING: (PENDING, DELETING),"},{"line_number":116,"context_line":"        STARTING: (ACTIVE, ERROR, DELETING),"},{"line_number":117,"context_line":"        UPDATING: STABLE + (DELETING,),"},{"line_number":118,"context_line":"        TERMINATING: (TERMINATED, ERROR, DELETING),"},{"line_number":119,"context_line":"        DELETING: (ERROR,)"},{"line_number":120,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_c302040a","line":117,"range":{"start_line":117,"start_character":27,"end_line":117,"end_character":38},"in_reply_to":"ff82abbf_9c181dd4","updated":"2017-11-22 05:17:02.000000000","message":"If a lease unexpectedly hangs up at the UPDATING status, I think the lease should be allowed to be deleted. That\u0027s why any status can transit to DELETING as shown in the state machine of the lease[1]. DELETE should be the highest prioritized operation.\n\n[1] https://docs.openstack.org/blazar/latest/specs/queens/state-machine.html","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"ccad357fe82e5ff1ad1575ca0ceb19f8c346e7e3","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        ERROR: (UPDATING, DELETING),"},{"line_number":115,"context_line":"        CREATING: (PENDING, DELETING),"},{"line_number":116,"context_line":"        STARTING: (ACTIVE, ERROR, DELETING),"},{"line_number":117,"context_line":"        UPDATING: STABLE + (DELETING,),"},{"line_number":118,"context_line":"        TERMINATING: (TERMINATED, ERROR, DELETING),"},{"line_number":119,"context_line":"        DELETING: (ERROR,)"},{"line_number":120,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_150309ba","line":117,"range":{"start_line":117,"start_character":27,"end_line":117,"end_character":38},"in_reply_to":"ff82abbf_c302040a","updated":"2017-11-24 03:41:30.000000000","message":"Got it.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        return True"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def manage_status(cls, transitional_status):"},{"line_number":171,"context_line":"        \"\"\"Decorator for managing the lease status."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        This checks and updates a lease status before and after *-lease methods"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_620d6b36","line":170,"range":{"start_line":170,"start_character":0,"end_line":170,"end_character":21},"updated":"2017-11-20 11:52:53.000000000","message":"IMO, it\u0027s better to use noun name for a decorator method.  transition_status or transitional_status looks good to me.\n\n\nIt looks like this method doing following two things. 1. checks the lease status whether the current status is accepted for the next transition status before calling *-lease method.  2. checks lease status is set by blazar-manager correctly or not after calling *-lease method.\n\nIf it\u0027s correct, it would work to call guess_stable_status() at step2 and to set the return value to the lease status. It can remove status logic from service.py.\n\nHow do you think?","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"ccad357fe82e5ff1ad1575ca0ceb19f8c346e7e3","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        return True"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def manage_status(cls, transitional_status):"},{"line_number":171,"context_line":"        \"\"\"Decorator for managing the lease status."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        This checks and updates a lease status before and after *-lease methods"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_f5c1c5e5","line":170,"range":{"start_line":170,"start_character":0,"end_line":170,"end_character":21},"in_reply_to":"ff82abbf_23b2d095","updated":"2017-11-24 03:41:30.000000000","message":"I understand why you\u0027re using the name. The reason I prefer \u0027noun\u0027 style is a decorator is a declarative operand in Python as you use @classmethod decorator for this function.\n\nI agree it\u0027s easy for new developer to know how the lease status change in *-lease status in current implementation. Drawbacks are 1. developers need to set lease status before returning the method every time. 2. someones need to read a *-lease method and called methods by *-lease when they want to know where the lease status is set.\n\nOn the other hand, if a lease status is only handled in statues.py, it can separate the logic from blazar-manager\u0027s task and lease status management since status lease is a declarative attribute.\n\nTo get both advantages, yours and mine, how do you think to change the decorator like this:\n\n @lease_status(transition\u003d\u0027STARTING\u0027, result_in\u003d[\u0027ACTIVE\u0027, \u0027ERROR\u0027]\n def start_lease(self)...","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        return True"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def manage_status(cls, transitional_status):"},{"line_number":171,"context_line":"        \"\"\"Decorator for managing the lease status."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        This checks and updates a lease status before and after *-lease methods"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_23b2d095","line":170,"range":{"start_line":170,"start_character":0,"end_line":170,"end_character":21},"in_reply_to":"ff82abbf_620d6b36","updated":"2017-11-22 05:17:02.000000000","message":"Could you give a supplementary explanation for naming? Current name looks more precisely describing what this decorator does to me. Is using noun a convention for decorator names?\n\n\nFor second point, your understanding is correct, thanks. I agree with your idea, however, at the same time, I think the status logic is better to be kept in the *-lease method for easier understanding of status transitions. I mean that developers can easily understand how the *-lease methods change a lease status by reading just *-lease logic because the status is obviously described in there. In contrast, if we encapsulate whole status logic into this decorator, developers have to understand this module to understand how *-lease modules change a lease status. That\u0027s why I made this decorator just checking if the status transition given by *-lease methods are correct.\n\nhmm... which is better... How do you think?","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"34efb1a5e2bc36851a996dcab55c0afc55decf76","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        return True"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @classmethod"},{"line_number":170,"context_line":"    def manage_status(cls, transitional_status):"},{"line_number":171,"context_line":"        \"\"\"Decorator for managing the lease status."},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        This checks and updates a lease status before and after *-lease methods"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_40f21172","line":170,"range":{"start_line":170,"start_character":0,"end_line":170,"end_character":21},"in_reply_to":"ff82abbf_f5c1c5e5","updated":"2017-11-27 02:07:08.000000000","message":"What a good solution! I\u0027ll update it based on your idea.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                        {\u0027status\u0027: cls.ERROR})"},{"line_number":198,"context_line":"                    raise e"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"                if lease:"},{"line_number":201,"context_line":"                    if cls.is_valid_transition(transitional_status,"},{"line_number":202,"context_line":"                                               lease[\u0027status\u0027],"},{"line_number":203,"context_line":"                                               lease_id\u003dlease_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_17914653","line":200,"range":{"start_line":200,"start_character":0,"end_line":200,"end_character":25},"updated":"2017-11-20 11:52:53.000000000","message":"Is there a case that lease is None?  If nothing, we can remove the if-statement.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"ccad357fe82e5ff1ad1575ca0ceb19f8c346e7e3","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                        {\u0027status\u0027: cls.ERROR})"},{"line_number":198,"context_line":"                    raise e"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"                if lease:"},{"line_number":201,"context_line":"                    if cls.is_valid_transition(transitional_status,"},{"line_number":202,"context_line":"                                               lease[\u0027status\u0027],"},{"line_number":203,"context_line":"                                               lease_id\u003dlease_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_90288734","line":200,"range":{"start_line":200,"start_character":0,"end_line":200,"end_character":25},"in_reply_to":"ff82abbf_03c54c5b","updated":"2017-11-24 03:41:30.000000000","message":"Got it.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":197,"context_line":"                                        {\u0027status\u0027: cls.ERROR})"},{"line_number":198,"context_line":"                    raise e"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"                if lease:"},{"line_number":201,"context_line":"                    if cls.is_valid_transition(transitional_status,"},{"line_number":202,"context_line":"                                               lease[\u0027status\u0027],"},{"line_number":203,"context_line":"                                               lease_id\u003dlease_id):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_03c54c5b","line":200,"range":{"start_line":200,"start_character":0,"end_line":200,"end_character":25},"in_reply_to":"ff82abbf_17914653","updated":"2017-11-22 05:17:02.000000000","message":"The delete_lease() does not return a lease.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        return decorator"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    @classmethod"},{"line_number":215,"context_line":"    def guess_stable_status(cls, lease_id):"},{"line_number":216,"context_line":"        \"\"\"Guess stable lease status."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        This guesses the lease status from statuses of reservations and"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_e2317bee","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":28},"updated":"2017-11-20 11:52:53.000000000","message":"define_stable_status looks better, isn\u0027t it?","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"ccad357fe82e5ff1ad1575ca0ceb19f8c346e7e3","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        return decorator"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    @classmethod"},{"line_number":215,"context_line":"    def guess_stable_status(cls, lease_id):"},{"line_number":216,"context_line":"        \"\"\"Guess stable lease status."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        This guesses the lease status from statuses of reservations and"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_701dc30d","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":28},"in_reply_to":"ff82abbf_83cf1caf","updated":"2017-11-24 03:41:30.000000000","message":"It makes sense.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        return decorator"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    @classmethod"},{"line_number":215,"context_line":"    def guess_stable_status(cls, lease_id):"},{"line_number":216,"context_line":"        \"\"\"Guess stable lease status."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"        This guesses the lease status from statuses of reservations and"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_83cf1caf","line":215,"range":{"start_line":215,"start_character":8,"end_line":215,"end_character":28},"in_reply_to":"ff82abbf_e2317bee","updated":"2017-11-22 05:17:02.000000000","message":"How about derive_stable_status? \u0027define\u0027 seems to statically set status but this method dynamically derive lease status from current statuses of  reservations and events.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"02ded1ff2696a6ac24d1cd46f568da0298fd15b1","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            return cls.ERROR"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"COMBINATIONS \u003d {"},{"line_number":255,"context_line":"    LeaseStatus.CREATING: {"},{"line_number":256,"context_line":"        \u0027reservation\u0027: (ReservationStatus.PENDING,),"},{"line_number":257,"context_line":"        \u0027start_lease\u0027: (EventStatus.UNDONE,),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_1f007c34","line":254,"range":{"start_line":254,"start_character":0,"end_line":254,"end_character":12},"updated":"2017-11-20 11:52:53.000000000","message":"To be clarified. Which is the correct definition for the \"COMBINATIONS\"? 1. a set of reservation status and event status the lease status accepts.  2. a set of reservation status and event status the lease status comes from.\n\nIf #1 is true, what the manage_status do under L199 is just calling guess_stable_status() and it define a lease status. It can also remove guess_stable_status() from service.py.\n\nIf #2 is true, the set of combination is not correct. For example, LeaseStatus.Active doesn\u0027t come from ReservationStatus.ACTIVE but from ReservationStatus.PENDING.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"e01529f367819903ce096a289ccf5fca793b0335","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            return cls.ERROR"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"COMBINATIONS \u003d {"},{"line_number":255,"context_line":"    LeaseStatus.CREATING: {"},{"line_number":256,"context_line":"        \u0027reservation\u0027: (ReservationStatus.PENDING,),"},{"line_number":257,"context_line":"        \u0027start_lease\u0027: (EventStatus.UNDONE,),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_ee1ccf6b","line":254,"range":{"start_line":254,"start_character":0,"end_line":254,"end_character":12},"in_reply_to":"ff82abbf_1f007c34","updated":"2017-11-22 05:17:02.000000000","message":"It\u0027s #1. what the manage_status does under L199 (calling is_valid_transition()) is not only the guess_stable_status() does but also checking the validity of the transition from current status to the next status. The guess_stable_status() just derives a lease status from current statuses of reservations and events. i.e. it does not care for the validity of transition.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"},{"author":{"_account_id":8878,"name":"Masahito Muroi","email":"masahito.muroi@g.softbank.co.jp","username":"masa"},"change_message_id":"ccad357fe82e5ff1ad1575ca0ceb19f8c346e7e3","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            return cls.ERROR"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"COMBINATIONS \u003d {"},{"line_number":255,"context_line":"    LeaseStatus.CREATING: {"},{"line_number":256,"context_line":"        \u0027reservation\u0027: (ReservationStatus.PENDING,),"},{"line_number":257,"context_line":"        \u0027start_lease\u0027: (EventStatus.UNDONE,),"}],"source_content_type":"text/x-python","patch_set":4,"id":"ff82abbf_d0a12fab","line":254,"range":{"start_line":254,"start_character":0,"end_line":254,"end_character":12},"in_reply_to":"ff82abbf_ee1ccf6b","updated":"2017-11-24 03:41:30.000000000","message":"Got it.","commit_id":"2a6761d0661b455c03811b06cf53d5edd1dac852"}],"blazar/tests/manager/test_service.py":[{"author":{"_account_id":15197,"name":"Pierre Riteau","email":"pierre@stackhpc.com","username":"priteau","status":"StackHPC"},"change_message_id":"46005859aa047ad7a566b08cdda567644afe212c","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        with mock.patch(\u0027blazar.status.lease.lease_status\u0027,"},{"line_number":120,"context_line":"                        FakeLeaseStatus.lease_status):"},{"line_number":121,"context_line":"            imp.reload(service)"},{"line_number":122,"context_line":"        self.service \u003d service"},{"line_number":123,"context_line":"        self.manager \u003d self.service.ManagerService()"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_5c362753","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":31},"updated":"2017-12-12 10:26:35.000000000","message":"Python 3 documentation says:\n\n    Deprecated since version 3.4: Use importlib.reload() instead.\n\nHowever Python 2 doesn\u0027t have this function in importlib.\nIt would be nice to have new code be Python 3 compatible from the start.\n\nAlso note that it seems in Python 2, reload() is a built-in function. No need to import imp?","commit_id":"e754d16bb1d110fa1c9b7263b0f8335d01fa6850"},{"author":{"_account_id":23840,"name":"Hiroaki Kobayashi","email":"kobayashi.hiroaki@lab.ntt.co.jp","username":"hiro-kobayashi"},"change_message_id":"85ceb5b9da5d6e00d882cfb018af67e05b688b64","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"        with mock.patch(\u0027blazar.status.lease.lease_status\u0027,"},{"line_number":120,"context_line":"                        FakeLeaseStatus.lease_status):"},{"line_number":121,"context_line":"            imp.reload(service)"},{"line_number":122,"context_line":"        self.service \u003d service"},{"line_number":123,"context_line":"        self.manager \u003d self.service.ManagerService()"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"df87a7cf_2a517e63","line":121,"range":{"start_line":121,"start_character":0,"end_line":121,"end_character":31},"in_reply_to":"df87a7cf_5c362753","updated":"2017-12-13 02:58:59.000000000","message":"I\u0027ve applied six.moves.reload_module for keeping python 2 and 3 compatibility.","commit_id":"e754d16bb1d110fa1c9b7263b0f8335d01fa6850"}]}
