)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@canonical.com","username":"toabctl"},"change_message_id":"1c7f369598ea4883b2467a9596faf81ebc2b29d9","unresolved":false,"context_lines":[{"line_number":5,"context_line":"CommitDate: 2019-01-02 21:05:24 +0100"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Reapply access rules when doing ensure share"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Change-Id: I1c8d63620bdb8dc43c318bee7a9bc545755ebb99"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"ffd0ebdf_182166fc","line":8,"updated":"2019-01-04 20:01:15.000000000","message":"Why is this useful? See https://wiki.openstack.org/wiki/GitCommitMessages#Information_in_commit_messages","commit_id":"df14c35fd32af5a7da694edc6a3fe030b4a50740"}],"manila/share/access.py":[{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        self.driver \u003d driver"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def update_access_rules(self, context, share_instance_id,"},{"line_number":237,"context_line":"                            delete_all_rules\u003dFalse, share_server\u003dNone):"},{"line_number":238,"context_line":"        \"\"\"Update access rules for a given share instance."},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        :param context: request context"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_0dc354ef","line":237,"range":{"start_line":237,"start_character":66,"end_line":237,"end_character":71},"updated":"2018-03-01 15:27:52.000000000","message":"2) receive parameter here","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                       \"belonging to share %(shr)s.\")"},{"line_number":281,"context_line":"                LOG.debug(msg, msg_payload)"},{"line_number":282,"context_line":"                self._update_access_rules(context, share_instance_id,"},{"line_number":283,"context_line":"                                          share_server\u003dshare_server)"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                msg \u003d (\"All access rules have been synced for share instance \""},{"line_number":286,"context_line":"                       \"%(si)s belonging to share %(shr)s.\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_0d6834f3","line":283,"range":{"start_line":283,"start_character":65,"end_line":283,"end_character":68},"updated":"2018-03-01 15:27:52.000000000","message":"3) pass it here again","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"},{"author":{"_account_id":2417,"name":"Ben Swartzlander","email":"ben@swartzlander.org","username":"bswartz"},"change_message_id":"5381a646ed0623a0942612e297586ec4b89c9714","unresolved":false,"context_lines":[{"line_number":280,"context_line":"                       \"belonging to share %(shr)s.\")"},{"line_number":281,"context_line":"                LOG.debug(msg, msg_payload)"},{"line_number":282,"context_line":"                self._update_access_rules(context, share_instance_id,"},{"line_number":283,"context_line":"                                          share_server\u003dshare_server)"},{"line_number":284,"context_line":"            else:"},{"line_number":285,"context_line":"                msg \u003d (\"All access rules have been synced for share instance \""},{"line_number":286,"context_line":"                       \"%(si)s belonging to share %(shr)s.\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_54c7a413","line":283,"range":{"start_line":283,"start_character":65,"end_line":283,"end_character":68},"in_reply_to":"1f9dbf25_0d6834f3","updated":"2018-03-01 16:44:57.000000000","message":"What is syncing_rules is not empty above? Then the whole refresh is lost. There has to be a DB change to cover situations where this is called while a sync is in progress.","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":287,"context_line":"                LOG.debug(msg, msg_payload)"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"    def _update_access_rules(self, context, share_instance_id,"},{"line_number":290,"context_line":"                             share_server\u003dNone):"},{"line_number":291,"context_line":"        # Refresh the share instance model"},{"line_number":292,"context_line":"        share_instance \u003d self.db.share_instance_get("},{"line_number":293,"context_line":"            context, share_instance_id, with_share_data\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_cd71ece2","line":290,"range":{"start_line":290,"start_character":44,"end_line":290,"end_character":47},"updated":"2018-03-01 15:27:52.000000000","message":"4) receive it here","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":314,"context_line":"            add_rules \u003d []"},{"line_number":315,"context_line":"            rules_to_be_removed_from_db \u003d delete_rules"},{"line_number":316,"context_line":"            delete_rules \u003d []"},{"line_number":317,"context_line":""},{"line_number":318,"context_line":"        try:"},{"line_number":319,"context_line":"            driver_rule_updates \u003d self._update_rules_through_share_driver("},{"line_number":320,"context_line":"                context, share_instance, access_rules_to_be_on_share,"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_4d7ddcaf","line":317,"updated":"2018-03-01 15:27:52.000000000","message":"5) add a condition here that sets add_rules and delete_rules to [] if force_recovery_mode is set.","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":574,"context_line":"            constants.ACCESS_STATE_DENYING:"},{"line_number":575,"context_line":"                constants.ACCESS_STATE_QUEUED_TO_DENY,"},{"line_number":576,"context_line":"        }"},{"line_number":577,"context_line":"        if requeue_active:"},{"line_number":578,"context_line":"            conditional_updates[constants.ACCESS_STATE_ACTIVE] \u003d ("},{"line_number":579,"context_line":"                constants.ACCESS_STATE_QUEUED_TO_APPLY)"},{"line_number":580,"context_line":"        self.get_and_update_share_instance_access_rules("},{"line_number":581,"context_line":"            context, share_instance_id\u003dshare_instance_id,"},{"line_number":582,"context_line":"            conditionally_change\u003dconditional_updates)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_b132baf0","line":579,"range":{"start_line":577,"start_character":8,"end_line":579,"end_character":55},"updated":"2018-03-01 15:27:52.000000000","message":"doing just this *could* cause problems with drivers that handle rules one by one, in a sense that they would be trying to add a rule that already exists, because they would receive the same rules in \"add_rules\". I am not 100% sure, so this needs testing (or a lot of code reading, or both) and see which drivers break. Unfortunately we will not be able to test this as this depends on ensure_share triggering this, as the API blocks requests to the same IP (unless we write some intentional debug patch that invokes update_access twice and see which CI breaks). \n\nAlternatively, the same drivers that *could* potentially break, are prepared to handle \"recovery mode\". To trigger this in the driver, you would need to pass add_rules and remove_rules as empty lists. To do that, you would need a condition in this class right before calling the driver. I added some comments with the changes necessary. Only those changes wouldn\u0027t work, as the code wouldn\u0027t get to that point if all rules are active (as it would assume there is nothing to do), so you would still need to change their state as you are doing here.","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"}],"manila/share/manager.py":[{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"8bf896c7a28754980a90a828ef4d4956a790ebd5","unresolved":false,"context_lines":[{"line_number":417,"context_line":""},{"line_number":418,"context_line":"            share_server \u003d self._get_share_server(ctxt, share_instance)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"            update_access_rules \u003d ("},{"line_number":421,"context_line":"                update_share_instances[share_instance[\u0027id\u0027]]"},{"line_number":422,"context_line":"                .get(\u0027access_rules\u0027)"},{"line_number":423,"context_line":"            )"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f9dbf25_aab6d8d8","line":420,"range":{"start_line":420,"start_character":12,"end_line":420,"end_character":31},"updated":"2018-02-28 16:34:27.000000000","message":"It looks like the update_access_rules doesn\u0027t store the real access rules, it is just a flag about whether we need to update the access even if the access rule status is \u0027active\u0027. Could we change it to \u0027is_update_access_rules\u0027? or something else.","commit_id":"b53bfbe5a51d75ea671760d79dfa2ca1cae4a2f9"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"8bf896c7a28754980a90a828ef4d4956a790ebd5","unresolved":false,"context_lines":[{"line_number":418,"context_line":"            share_server \u003d self._get_share_server(ctxt, share_instance)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"            update_access_rules \u003d ("},{"line_number":421,"context_line":"                update_share_instances[share_instance[\u0027id\u0027]]"},{"line_number":422,"context_line":"                .get(\u0027access_rules\u0027)"},{"line_number":423,"context_line":"            )"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"            if share_instance[\u0027access_rules_status\u0027] !\u003d ("}],"source_content_type":"text/x-python","patch_set":1,"id":"1f9dbf25_8a275c65","line":422,"range":{"start_line":421,"start_character":16,"end_line":422,"end_character":36},"updated":"2018-02-28 16:34:27.000000000","message":"Could you add some descriptions about \u0027access_rules\u0027 in ensure_shares function.\nhttps://github.com/openstack/manila/blob/master/manila/share/driver.py#L2557","commit_id":"b53bfbe5a51d75ea671760d79dfa2ca1cae4a2f9"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"8bf896c7a28754980a90a828ef4d4956a790ebd5","unresolved":false,"context_lines":[{"line_number":419,"context_line":""},{"line_number":420,"context_line":"            update_access_rules \u003d ("},{"line_number":421,"context_line":"                update_share_instances[share_instance[\u0027id\u0027]]"},{"line_number":422,"context_line":"                .get(\u0027access_rules\u0027)"},{"line_number":423,"context_line":"            )"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"            if share_instance[\u0027access_rules_status\u0027] !\u003d ("}],"source_content_type":"text/x-python","patch_set":1,"id":"1f9dbf25_0ac58c3c","line":422,"range":{"start_line":422,"start_character":22,"end_line":422,"end_character":34},"updated":"2018-02-28 16:34:27.000000000","message":"above, just about the name","commit_id":"b53bfbe5a51d75ea671760d79dfa2ca1cae4a2f9"},{"author":{"_account_id":14567,"name":"Rodrigo Barbieri","email":"rodrigo.barbieri2010@gmail.com","username":"ganso"},"change_message_id":"a6adad522de53b5ddc12721179b8509c7b225ac4","unresolved":false,"context_lines":[{"line_number":430,"context_line":"                        ctxt, share_instance[\u0027id\u0027],"},{"line_number":431,"context_line":"                        requeue_active\u003dupdate_access_rules)"},{"line_number":432,"context_line":"                    self.access_helper.update_access_rules("},{"line_number":433,"context_line":"                        ctxt, share_instance[\u0027id\u0027], share_server\u003dshare_server)"},{"line_number":434,"context_line":"                except Exception:"},{"line_number":435,"context_line":"                    LOG.exception("},{"line_number":436,"context_line":"                        (\"Unexpected error occurred while updating access \""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f9dbf25_cda32c4f","line":433,"range":{"start_line":433,"start_character":76,"end_line":433,"end_character":78},"updated":"2018-03-01 15:27:52.000000000","message":"1) can add a parameter here: \"force_recovery_mode\u003dTrue\"","commit_id":"0991f7cc544e92bd070f3c6de851658138b933d4"}],"manila/tests/share/test_manager.py":[{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@canonical.com","username":"toabctl"},"change_message_id":"1c7f369598ea4883b2467a9596faf81ebc2b29d9","unresolved":false,"context_lines":[{"line_number":302,"context_line":"    @ddt.unpack"},{"line_number":303,"context_line":"    def test_init_host_with_shares_and_rules("},{"line_number":304,"context_line":"            self, old_backend_info_hash, new_backend_info):"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        # initialization of test data"},{"line_number":307,"context_line":"        def raise_share_access_exists(*args, **kwargs):"},{"line_number":308,"context_line":"            raise exception.ShareAccessExists("}],"source_content_type":"text/x-python","patch_set":3,"id":"ffd0ebdf_38454ab4","side":"PARENT","line":305,"updated":"2019-01-04 20:01:15.000000000","message":"unrelated","commit_id":"d144bf7593241ada3982faa9fdb60279e5d7309c"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@canonical.com","username":"toabctl"},"change_message_id":"1c7f369598ea4883b2467a9596faf81ebc2b29d9","unresolved":false,"context_lines":[{"line_number":51,"context_line":"from manila import utils"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def fake_backend_info(info_hash, as_primitive\u003dFalse, **kwargs):"},{"line_number":55,"context_line":"    backend_info \u003d {"},{"line_number":56,"context_line":"        \u0027host\u0027: \u0027fake_host\u0027,"},{"line_number":57,"context_line":"        \u0027info_hash\u0027: info_hash,"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffd0ebdf_980d5692","line":54,"updated":"2019-01-04 20:01:15.000000000","message":"please use it or remove it","commit_id":"df14c35fd32af5a7da694edc6a3fe030b4a50740"}]}
