)]}'
{"etc/glance/rootwrap.d/glance_cinder_store.filters":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"73eec3cf1fa5c542750e264ca02c851d3e849eec","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"1f493fa4_3124ebae","line":19,"updated":"2020-04-29 18:19:19.000000000","message":"Shouldn\u0027t the last three lines be:\n\numount: CommandFilter, umount, root\nmkdir: CommandFilter, mkdir, root\nrmdir: CommandFilter, rmdir, root\n\n?","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"1f493fa4_31722bae","line":19,"in_reply_to":"1f493fa4_3124ebae","updated":"2020-04-29 18:27:03.000000000","message":"Yeah, this looks like a copy/paste error.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":10,"id":"1f493fa4_34d84fed","line":19,"in_reply_to":"1f493fa4_31722bae","updated":"2020-04-30 07:24:06.000000000","message":"opps my bad. Done.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"}],"glance_store/_drivers/cinder.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_concurrency import processutils"},{"line_number":28,"context_line":"from oslo_config import cfg"},{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"from glance_store._drivers import fs_mount as mount"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_ae4bdcad","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":10},"updated":"2020-04-17 15:41:02.000000000","message":"there is no need for this as we do not support py27 anymore.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_concurrency import processutils"},{"line_number":28,"context_line":"from oslo_config import cfg"},{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"from glance_store._drivers import fs_mount as mount"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_94d756ee","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":10},"in_reply_to":"1f493fa4_2f555a51","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"52a0873be7c0294fd0bd114d45be95947a4d89e4","unresolved":false,"context_lines":[{"line_number":27,"context_line":"from oslo_concurrency import processutils"},{"line_number":28,"context_line":"from oslo_config import cfg"},{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"from glance_store._drivers import fs_mount as mount"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_2f555a51","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":10},"in_reply_to":"3f4c43b2_ae4bdcad","updated":"2020-04-21 18:20:18.000000000","message":"+1","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"bc7fc98c542ddc974ad53aa5ab685d4a0257c5a8","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"from glance_store._drivers import fs_mount as mount"},{"line_number":34,"context_line":"from glance_store import capabilities"},{"line_number":35,"context_line":"from glance_store.common import utils"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_d866ee29","line":32,"updated":"2020-04-17 13:07:26.000000000","message":"Extra line added here that could be removed if you have a need to do another update.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":"import six"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"from glance_store._drivers import fs_mount as mount"},{"line_number":34,"context_line":"from glance_store import capabilities"},{"line_number":35,"context_line":"from glance_store.common import utils"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_d4e1ded2","line":32,"in_reply_to":"3f4c43b2_d866ee29","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        If base_str is a Unicode string, encode it to UTF-8."},{"line_number":535,"context_line":"        \"\"\""},{"line_number":536,"context_line":"        if isinstance(base_str, six.text_type):"},{"line_number":537,"context_line":"            base_str \u003d base_str.encode(\u0027utf-8\u0027)"},{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_6e51d462","line":536,"range":{"start_line":536,"start_character":32,"end_line":536,"end_character":45},"updated":"2020-04-17 15:41:02.000000000","message":"could use String, as we do not support py27 anymore there is no reason to introduce six.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":533,"context_line":""},{"line_number":534,"context_line":"        If base_str is a Unicode string, encode it to UTF-8."},{"line_number":535,"context_line":"        \"\"\""},{"line_number":536,"context_line":"        if isinstance(base_str, six.text_type):"},{"line_number":537,"context_line":"            base_str \u003d base_str.encode(\u0027utf-8\u0027)"},{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_34000268","line":536,"range":{"start_line":536,"start_character":32,"end_line":536,"end_character":45},"in_reply_to":"3f4c43b2_6e51d462","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        \"\"\""},{"line_number":536,"context_line":"        if isinstance(base_str, six.text_type):"},{"line_number":537,"context_line":"            base_str \u003d base_str.encode(\u0027utf-8\u0027)"},{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def _get_mount_path(self, share, mount_point_base):"},{"line_number":541,"context_line":"        \"\"\"Returns the mount path prefix using the mount point base and share."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_0e63f043","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":48},"updated":"2020-04-17 15:41:02.000000000","message":"We definitely should not introduce _any_ new usage of md5 while we\u0027re trying to get rid of it in Glance.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"52a0873be7c0294fd0bd114d45be95947a4d89e4","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        \"\"\""},{"line_number":536,"context_line":"        if isinstance(base_str, six.text_type):"},{"line_number":537,"context_line":"            base_str \u003d base_str.encode(\u0027utf-8\u0027)"},{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def _get_mount_path(self, share, mount_point_base):"},{"line_number":541,"context_line":"        \"\"\"Returns the mount path prefix using the mount point base and share."}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_2fda7ae8","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":48},"in_reply_to":"3f4c43b2_0e63f043","updated":"2020-04-21 18:20:18.000000000","message":"+1, we are getting rid of md5 in glance.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        \"\"\""},{"line_number":536,"context_line":"        if isinstance(base_str, six.text_type):"},{"line_number":537,"context_line":"            base_str \u003d base_str.encode(\u0027utf-8\u0027)"},{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def _get_mount_path(self, share, mount_point_base):"},{"line_number":541,"context_line":"        \"\"\"Returns the mount path prefix using the mount point base and share."}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_3446427e","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":48},"in_reply_to":"3f4c43b2_0e63f043","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"bc7fc98c542ddc974ad53aa5ab685d4a0257c5a8","unresolved":false,"context_lines":[{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def _get_mount_path(self, share, mount_point_base):"},{"line_number":541,"context_line":"        \"\"\"Returns the mount path prefix using the mount point base and share."},{"line_number":542,"context_line":"        :returns: The mount path prefix."},{"line_number":543,"context_line":"        \"\"\""},{"line_number":544,"context_line":"        return os.path.join(mount_point_base, self.get_hash_str(share))"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_7877dad5","line":541,"updated":"2020-04-17 13:07:26.000000000","message":"Should have blank line after summary line.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":538,"context_line":"        return hashlib.md5(base_str).hexdigest()"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    def _get_mount_path(self, share, mount_point_base):"},{"line_number":541,"context_line":"        \"\"\"Returns the mount path prefix using the mount point base and share."},{"line_number":542,"context_line":"        :returns: The mount path prefix."},{"line_number":543,"context_line":"        \"\"\""},{"line_number":544,"context_line":"        return os.path.join(mount_point_base, self.get_hash_str(share))"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_144b4684","line":541,"in_reply_to":"3f4c43b2_7877dad5","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from glance_store import capabilities"},{"line_number":32,"context_line":"from glance_store.common import utils, fs_mount as mount"},{"line_number":33,"context_line":"from glance_store import exceptions"},{"line_number":34,"context_line":"from glance_store.i18n import _, _LE, _LI"},{"line_number":35,"context_line":"import glance_store.location"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_51a41708","line":32,"range":{"start_line":32,"start_character":37,"end_line":32,"end_character":56},"updated":"2020-04-29 18:27:03.000000000","message":"Coding guidelines state there should only be one import per line (other than the i18n one below that is already too prevalent).","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from glance_store import capabilities"},{"line_number":32,"context_line":"from glance_store.common import utils, fs_mount as mount"},{"line_number":33,"context_line":"from glance_store import exceptions"},{"line_number":34,"context_line":"from glance_store.i18n import _, _LE, _LI"},{"line_number":35,"context_line":"import glance_store.location"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_a210cf4f","line":32,"updated":"2020-04-30 11:35:02.000000000","message":"For readability sake we really should split these to their own lines.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[{"line_number":29,"context_line":"from oslo_utils import units"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"from glance_store import capabilities"},{"line_number":32,"context_line":"from glance_store.common import utils, fs_mount as mount"},{"line_number":33,"context_line":"from glance_store import exceptions"},{"line_number":34,"context_line":"from glance_store.i18n import _, _LE, _LI"},{"line_number":35,"context_line":"import glance_store.location"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_d4f2cb6f","line":32,"range":{"start_line":32,"start_character":37,"end_line":32,"end_character":56},"in_reply_to":"1f493fa4_51a41708","updated":"2020-04-30 07:24:06.000000000","message":"Done.\nI\u0027ve moved this in init and added a comment why we are doing that.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6f18128d9942be02675b53bf406d0223de2c81d8","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                        export,"},{"line_number":589,"context_line":"                        os.path.join(mount_point_base, \u0027nfs\u0027))"},{"line_number":590,"context_line":"                    options \u003d data[\u0027options\u0027]"},{"line_number":591,"context_line":"                    mount.mount( # noqa"},{"line_number":592,"context_line":"                        \u0027nfs\u0027, export, vol_name, mountpoint, host,"},{"line_number":593,"context_line":"                        root_helper, options)"},{"line_number":594,"context_line":"                    return {\u0027path\u0027: os.path.join(mountpoint, vol_name)}"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f493fa4_1641cea9","line":591,"range":{"start_line":591,"start_character":20,"end_line":591,"end_character":32},"updated":"2020-04-30 15:14:58.000000000","message":"It is throwing NameError: name \u0027mount\u0027 is not defined","commit_id":"3e33cfad394afc6a6b5183fac45e7919c8a95d52"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"de73b02ca365c3888c31cf672a0d97c72c7a3e37","unresolved":false,"context_lines":[{"line_number":588,"context_line":"                        export,"},{"line_number":589,"context_line":"                        os.path.join(mount_point_base, \u0027nfs\u0027))"},{"line_number":590,"context_line":"                    options \u003d data[\u0027options\u0027]"},{"line_number":591,"context_line":"                    mount.mount( # noqa"},{"line_number":592,"context_line":"                        \u0027nfs\u0027, export, vol_name, mountpoint, host,"},{"line_number":593,"context_line":"                        root_helper, options)"},{"line_number":594,"context_line":"                    return {\u0027path\u0027: os.path.join(mountpoint, vol_name)}"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f493fa4_61584e55","line":591,"range":{"start_line":591,"start_character":20,"end_line":591,"end_character":32},"in_reply_to":"1f493fa4_1641cea9","updated":"2020-04-30 15:28:18.000000000","message":"Hmm-m perhaps we should try to move the fs_mount import from the __init__ to just being done after L#50 at which point we have the config setup and available already.","commit_id":"3e33cfad394afc6a6b5183fac45e7919c8a95d52"}],"glance_store/_drivers/fs_mount.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_concurrency import processutils"},{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from glance_store import exceptions"},{"line_number":24,"context_line":"from glance_store.i18n import _LE, _LW"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_893ffa23","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":10},"updated":"2020-04-17 15:41:02.000000000","message":"as we don\u0027t support Py27 anymore there is no need to introduce six. We can just use String for the same instead.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from oslo_concurrency import processutils"},{"line_number":20,"context_line":"from oslo_log import log"},{"line_number":21,"context_line":"import six"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"from glance_store import exceptions"},{"line_number":24,"context_line":"from glance_store.i18n import _LE, _LW"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_d4355ef9","line":21,"range":{"start_line":21,"start_character":0,"end_line":21,"end_character":10},"in_reply_to":"3f4c43b2_893ffa23","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    not need to consider interactions between multiple _HostMountStateManager"},{"line_number":37,"context_line":"    calls when designing their own locking."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    _HostMountStateManager is a singleton, and must only be accessed via:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"      fs_mount.get_manager()"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    # Reset state of global _HostMountStateManager"},{"line_number":44,"context_line":"    state \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_a473fb4c","line":41,"range":{"start_line":39,"start_character":0,"end_line":41,"end_character":28},"updated":"2020-04-17 15:41:02.000000000","message":"Singletons are really non-pythonic in every possible way as they really doesn\u0027t exists and should not be done in the first place (using for example module instead). But lets put that aside, this is definitely the wrong way to do it.\n\nWe could use decorator and wrap this class, but I think utilizing \u0027metaclass\u0027 is the least horrible approach here. Feel free to ping me for pointers on this if needed.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b5f39afada2abff3d1859f54223712e867641517","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    not need to consider interactions between multiple _HostMountStateManager"},{"line_number":37,"context_line":"    calls when designing their own locking."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    _HostMountStateManager is a singleton, and must only be accessed via:"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"      fs_mount.get_manager()"},{"line_number":42,"context_line":"    \"\"\""},{"line_number":43,"context_line":"    # Reset state of global _HostMountStateManager"},{"line_number":44,"context_line":"    state \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_2aa2689b","line":41,"range":{"start_line":39,"start_character":0,"end_line":41,"end_character":28},"in_reply_to":"3f4c43b2_a473fb4c","updated":"2020-04-21 20:08:10.000000000","message":"I disagree that singleton are non-pythonic.\nThe main issue we\u0027ve with singleton is it isn\u0027t thread safe which is handled in the code with the help of threading lock and conditional.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        with self.cond:"},{"line_number":89,"context_line":"            state \u003d self.state"},{"line_number":90,"context_line":"            if state is None:"},{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_e47ce3ec","line":91,"range":{"start_line":91,"start_character":32,"end_line":91,"end_character":35},"updated":"2020-04-17 15:41:02.000000000","message":"NIT: not","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":88,"context_line":"        with self.cond:"},{"line_number":89,"context_line":"            state \u003d self.state"},{"line_number":90,"context_line":"            if state is None:"},{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_94047619","line":91,"range":{"start_line":91,"start_character":32,"end_line":91,"end_character":35},"in_reply_to":"3f4c43b2_e47ce3ec","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        :rtype: _HostMountState"},{"line_number":83,"context_line":"        \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # We hold the instance lock here so that if a _HostMountState is"},{"line_number":86,"context_line":"        # currently initialising we\u0027ll wait for it to complete rather than"},{"line_number":87,"context_line":"        # fail."},{"line_number":88,"context_line":"        with self.cond:"},{"line_number":89,"context_line":"            state \u003d self.state"},{"line_number":90,"context_line":"            if state is None:"},{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            LOG.debug(\u0027Got _HostMountState\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_44367754","line":92,"range":{"start_line":85,"start_character":7,"end_line":92,"end_character":67},"updated":"2020-04-17 15:41:02.000000000","message":"But we don\u0027t wait, we raise in this case? If we are supposed to wait here, shouldn\u0027t we have wait logic with some reasonable timeout instead of failing right away?","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b5f39afada2abff3d1859f54223712e867641517","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        :rtype: _HostMountState"},{"line_number":83,"context_line":"        \"\"\""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        # We hold the instance lock here so that if a _HostMountState is"},{"line_number":86,"context_line":"        # currently initialising we\u0027ll wait for it to complete rather than"},{"line_number":87,"context_line":"        # fail."},{"line_number":88,"context_line":"        with self.cond:"},{"line_number":89,"context_line":"            state \u003d self.state"},{"line_number":90,"context_line":"            if state is None:"},{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            LOG.debug(\u0027Got _HostMountState\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_ea9ec005","line":92,"range":{"start_line":85,"start_character":7,"end_line":92,"end_character":67},"in_reply_to":"3f4c43b2_44367754","updated":"2020-04-21 20:08:10.000000000","message":"There are 2 cases here:\n1) the wait is done with the help of self.cond that won\u0027t allow state initialization until other thread has completed\n2) The exception is raised when we fail to intialize the MountState class","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            LOG.debug(\u0027Got _HostMountState\u0027)"},{"line_number":96,"context_line":"            yield state"},{"line_number":97,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_c4228700","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":12},"updated":"2020-04-17 15:41:02.000000000","message":"Why the try here? What are we expecting to fail?","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b5f39afada2abff3d1859f54223712e867641517","unresolved":false,"context_lines":[{"line_number":91,"context_line":"                LOG.error(\u0027Host Not initialized\u0027)"},{"line_number":92,"context_line":"                raise exceptions.HostNotInitialized(host\u003dself.host)"},{"line_number":93,"context_line":"            self.use_count +\u003d 1"},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            LOG.debug(\u0027Got _HostMountState\u0027)"},{"line_number":96,"context_line":"            yield state"},{"line_number":97,"context_line":"        finally:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_65fdc339","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":12},"in_reply_to":"3f4c43b2_c4228700","updated":"2020-04-21 20:08:10.000000000","message":"Here we get the mount state and perform the desired mount/umount operation.\nIf anything occurs during the whole process, we atleast free up the thread in the finally block so other threads can do their operations.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            mount \u003d self.mountpoints[mountpoint]"},{"line_number":161,"context_line":"            with mount.lock:"},{"line_number":162,"context_line":"                if self.mountpoints[mountpoint] is mount:"},{"line_number":163,"context_line":"                    yield mount"},{"line_number":164,"context_line":"                    break"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def mount(self, fstype, export, vol_name, mountpoint, host,"},{"line_number":167,"context_line":"              rootwrap_helper, options):"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_c9ac6236","line":164,"range":{"start_line":163,"start_character":20,"end_line":164,"end_character":25},"updated":"2020-04-17 15:41:02.000000000","message":"return mount","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            mount \u003d self.mountpoints[mountpoint]"},{"line_number":161,"context_line":"            with mount.lock:"},{"line_number":162,"context_line":"                if self.mountpoints[mountpoint] is mount:"},{"line_number":163,"context_line":"                    yield mount"},{"line_number":164,"context_line":"                    break"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def mount(self, fstype, export, vol_name, mountpoint, host,"},{"line_number":167,"context_line":"              rootwrap_helper, options):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_e8e19e00","line":164,"range":{"start_line":163,"start_character":20,"end_line":164,"end_character":25},"in_reply_to":"3f4c43b2_c9ac6236","updated":"2020-04-22 10:25:24.000000000","message":"I think the point of this code is to make it work as a generator so i would prefer to keep it this way.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"bc7fc98c542ddc974ad53aa5ab685d4a0257c5a8","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"def mount(fstype, export, vol_name, mountpoint, host, rootwrap_helper,"},{"line_number":315,"context_line":"          options\u003dNone):"},{"line_number":316,"context_line":"    \"\"\"A convenience wrapper around _HostMountState.mount(), called via the"},{"line_number":317,"context_line":"    _HostMountStateManager singleton."},{"line_number":318,"context_line":"    \"\"\""},{"line_number":319,"context_line":"    with __manager__.get_state() as mount_state:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_58093e2f","line":316,"updated":"2020-04-17 13:07:26.000000000","message":"Very trivial nit, but should all be on a single line, else it should be a summary line separated from a longer description.\n\nBut I\u0027m probably the only one that has a fixation with pep257. :)","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":313,"context_line":""},{"line_number":314,"context_line":"def mount(fstype, export, vol_name, mountpoint, host, rootwrap_helper,"},{"line_number":315,"context_line":"          options\u003dNone):"},{"line_number":316,"context_line":"    \"\"\"A convenience wrapper around _HostMountState.mount(), called via the"},{"line_number":317,"context_line":"    _HostMountStateManager singleton."},{"line_number":318,"context_line":"    \"\"\""},{"line_number":319,"context_line":"    with __manager__.get_state() as mount_state:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_28e38607","line":316,"in_reply_to":"3f4c43b2_58093e2f","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"}],"glance_store/common/fs_mount.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from oslo_concurrency import processutils"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from glance_store import exceptions"},{"line_number":23,"context_line":"from glance_store.i18n import _LE, _LW"},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"HOST \u003d socket.gethostname()"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_62950b87","line":23,"updated":"2020-04-30 11:35:02.000000000","message":"NIT: two empty lines here to separate the LOG from imports","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from oslo_concurrency import processutils"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from glance_store import exceptions"},{"line_number":23,"context_line":"from glance_store.i18n import _LE, _LW"},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"HOST \u003d socket.gethostname()"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_aa36b34f","line":23,"in_reply_to":"1f493fa4_62950b87","updated":"2020-04-30 13:16:44.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from glance_store import exceptions"},{"line_number":23,"context_line":"from glance_store.i18n import _LE, _LW"},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"HOST \u003d socket.gethostname()"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_31806b46","line":24,"updated":"2020-04-29 18:27:03.000000000","message":"Would be good to have at least one blank line after the last import.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from glance_store import exceptions"},{"line_number":23,"context_line":"from glance_store.i18n import _LE, _LW"},{"line_number":24,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"HOST \u003d socket.gethostname()"},{"line_number":27,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_b4f57f59","line":24,"in_reply_to":"1f493fa4_31806b46","updated":"2020-04-30 07:24:06.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    # Guards both state and use_count"},{"line_number":56,"context_line":"    cond \u003d threading.Condition()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def __init__(self, host):"},{"line_number":59,"context_line":"        \"\"\"Initialise a new _HostMountState"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        We will block before creating a new state until all operations"},{"line_number":62,"context_line":"        using a previous state have completed."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        :param host: host"},{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        # Wait until all operations using a previous state are"},{"line_number":67,"context_line":"        # complete before initialising a new one. Note that self.state is"},{"line_number":68,"context_line":"        # already None, set either by initialisation or by host_down. This"},{"line_number":69,"context_line":"        # means the current state will not be returned to any new callers,"},{"line_number":70,"context_line":"        # and use_count will eventually reach zero."},{"line_number":71,"context_line":"        # We do this to avoid a race between _HostMountState initialisation"},{"line_number":72,"context_line":"        # and an on-going mount/unmount operation"},{"line_number":73,"context_line":"        self.host \u003d host"},{"line_number":74,"context_line":"        while self.use_count !\u003d 0:"},{"line_number":75,"context_line":"            self.cond.wait()"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        # Another thread might have initialised state while we were"},{"line_number":78,"context_line":"        # waiting"},{"line_number":79,"context_line":"        if self.state is None:"},{"line_number":80,"context_line":"            LOG.debug(\u0027Initialising _HostMountState\u0027)"},{"line_number":81,"context_line":"            self.state \u003d _HostMountState()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @contextlib.contextmanager"},{"line_number":84,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_62486b2c","line":81,"range":{"start_line":58,"start_character":0,"end_line":81,"end_character":42},"updated":"2020-04-30 11:35:02.000000000","message":"As discussed around on IRC we probably should walk through the mount path and see if we have any mounts lingering upon startup and clean those. that would avoid us leaking mounts/sockets over restarts.\n\nNot sure if it belongs here or in the _HostMountState","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":55,"context_line":"    # Guards both state and use_count"},{"line_number":56,"context_line":"    cond \u003d threading.Condition()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def __init__(self, host):"},{"line_number":59,"context_line":"        \"\"\"Initialise a new _HostMountState"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        We will block before creating a new state until all operations"},{"line_number":62,"context_line":"        using a previous state have completed."},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"        :param host: host"},{"line_number":65,"context_line":"        \"\"\""},{"line_number":66,"context_line":"        # Wait until all operations using a previous state are"},{"line_number":67,"context_line":"        # complete before initialising a new one. Note that self.state is"},{"line_number":68,"context_line":"        # already None, set either by initialisation or by host_down. This"},{"line_number":69,"context_line":"        # means the current state will not be returned to any new callers,"},{"line_number":70,"context_line":"        # and use_count will eventually reach zero."},{"line_number":71,"context_line":"        # We do this to avoid a race between _HostMountState initialisation"},{"line_number":72,"context_line":"        # and an on-going mount/unmount operation"},{"line_number":73,"context_line":"        self.host \u003d host"},{"line_number":74,"context_line":"        while self.use_count !\u003d 0:"},{"line_number":75,"context_line":"            self.cond.wait()"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"        # Another thread might have initialised state while we were"},{"line_number":78,"context_line":"        # waiting"},{"line_number":79,"context_line":"        if self.state is None:"},{"line_number":80,"context_line":"            LOG.debug(\u0027Initialising _HostMountState\u0027)"},{"line_number":81,"context_line":"            self.state \u003d _HostMountState()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    @contextlib.contextmanager"},{"line_number":84,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_0a41a7a9","line":81,"range":{"start_line":58,"start_character":0,"end_line":81,"end_character":42},"in_reply_to":"1f493fa4_62486b2c","updated":"2020-04-30 13:16:44.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":121,"context_line":"      with mount.get_manager().get_state() as state:"},{"line_number":122,"context_line":"        state.mount(...)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    On creation _HostMountState inspects the glance host directly to discover"},{"line_number":125,"context_line":"    all current mountpoints and the attachments on them. After creation it"},{"line_number":126,"context_line":"    expects to have exclusive control of these mountpoints until it is"},{"line_number":127,"context_line":"    destroyed."},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    _HostMountState manages concurrency itself. Independent callers do not need"},{"line_number":130,"context_line":"    to consider interactions between multiple _HostMountState calls when"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_c21a1f15","line":127,"range":{"start_line":124,"start_character":0,"end_line":127,"end_character":14},"updated":"2020-04-30 11:35:02.000000000","message":"I don\u0027t see this implemented anywhere.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":121,"context_line":"      with mount.get_manager().get_state() as state:"},{"line_number":122,"context_line":"        state.mount(...)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    On creation _HostMountState inspects the glance host directly to discover"},{"line_number":125,"context_line":"    all current mountpoints and the attachments on them. After creation it"},{"line_number":126,"context_line":"    expects to have exclusive control of these mountpoints until it is"},{"line_number":127,"context_line":"    destroyed."},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"    _HostMountState manages concurrency itself. Independent callers do not need"},{"line_number":130,"context_line":"    to consider interactions between multiple _HostMountState calls when"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_4a6c4f9b","line":127,"range":{"start_line":124,"start_character":0,"end_line":127,"end_character":14},"in_reply_to":"1f493fa4_c21a1f15","updated":"2020-04-30 13:16:44.000000000","message":"Yep, this was related to the vm\u0027s on the compute host and mountpoints associated with them, it isn\u0027t used/required in this case so removed.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                 root_helper\u003drootwrap_helper)"},{"line_number":292,"context_line":"        except processutils.ProcessExecutionError as ex:"},{"line_number":293,"context_line":"            LOG.error(_LE(\"Couldn\u0027t unmount %(mountpoint)s: %(reason)s\"),"},{"line_number":294,"context_line":"                      {\u0027mountpoint\u0027: mountpoint, \u0027reason\u0027: str(ex)})"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        if not os.path.ismount(mountpoint):"},{"line_number":297,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_f1d7234a","line":294,"range":{"start_line":294,"start_character":59,"end_line":294,"end_character":62},"updated":"2020-04-29 18:27:03.000000000","message":"Shouldn\u0027t need to force this into a string when it\u0027s being formatted into a string with %s.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                                 root_helper\u003drootwrap_helper)"},{"line_number":292,"context_line":"        except processutils.ProcessExecutionError as ex:"},{"line_number":293,"context_line":"            LOG.error(_LE(\"Couldn\u0027t unmount %(mountpoint)s: %(reason)s\"),"},{"line_number":294,"context_line":"                      {\u0027mountpoint\u0027: mountpoint, \u0027reason\u0027: str(ex)})"},{"line_number":295,"context_line":""},{"line_number":296,"context_line":"        if not os.path.ismount(mountpoint):"},{"line_number":297,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_5406bb53","line":294,"range":{"start_line":294,"start_character":59,"end_line":294,"end_character":62},"in_reply_to":"1f493fa4_f1d7234a","updated":"2020-04-30 07:24:06.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                LOG.error(_LE(\"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":301,"context_line":"                              \"%(reason)s\"),"},{"line_number":302,"context_line":"                          {\u0027mountpoint\u0027: mountpoint,"},{"line_number":303,"context_line":"                           \u0027reason\u0027: str(ex)})"},{"line_number":304,"context_line":"            return False"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_91c85fa6","line":303,"range":{"start_line":303,"start_character":37,"end_line":303,"end_character":40},"updated":"2020-04-29 18:27:03.000000000","message":"Same.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[{"line_number":300,"context_line":"                LOG.error(_LE(\"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":301,"context_line":"                              \"%(reason)s\"),"},{"line_number":302,"context_line":"                          {\u0027mountpoint\u0027: mountpoint,"},{"line_number":303,"context_line":"                           \u0027reason\u0027: str(ex)})"},{"line_number":304,"context_line":"            return False"},{"line_number":305,"context_line":""},{"line_number":306,"context_line":"        return True"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_94fcc33e","line":303,"range":{"start_line":303,"start_character":37,"end_line":303,"end_character":40},"in_reply_to":"1f493fa4_91c85fa6","updated":"2020-04-30 07:24:06.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"def mount(fstype, export, vol_name, mountpoint, host, rootwrap_helper,"},{"line_number":313,"context_line":"          options\u003dNone):"},{"line_number":314,"context_line":"    \"\"\"A convenience wrapper around _HostMountState.mount(), called via the"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    _HostMountStateManager."},{"line_number":317,"context_line":"    \"\"\""},{"line_number":318,"context_line":"    with __manager__.get_state() as mount_state:"},{"line_number":319,"context_line":"        mount_state.mount(fstype, export, vol_name, mountpoint, host,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_113a8f97","line":316,"range":{"start_line":314,"start_character":61,"end_line":316,"end_character":26},"updated":"2020-04-29 18:27:03.000000000","message":"Odd to have a one line comment broken into multiple, but I don\u0027t think you need to call out in the docstring what a method is being called by. That has potential to change over time anyway.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"c0160685ac04ba993d9c7bdc24bb790ddfd70d52","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"def mount(fstype, export, vol_name, mountpoint, host, rootwrap_helper,"},{"line_number":313,"context_line":"          options\u003dNone):"},{"line_number":314,"context_line":"    \"\"\"A convenience wrapper around _HostMountState.mount(), called via the"},{"line_number":315,"context_line":""},{"line_number":316,"context_line":"    _HostMountStateManager."},{"line_number":317,"context_line":"    \"\"\""},{"line_number":318,"context_line":"    with __manager__.get_state() as mount_state:"},{"line_number":319,"context_line":"        mount_state.mount(fstype, export, vol_name, mountpoint, host,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_f4a0a744","line":316,"range":{"start_line":314,"start_character":61,"end_line":316,"end_character":26},"in_reply_to":"1f493fa4_113a8f97","updated":"2020-04-30 07:24:06.000000000","message":"Done","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fa965cf5cf87af4bbd64e9495c53479efe3e29d7","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            else:"},{"line_number":92,"context_line":"                backends.append(\u0027glance_store\u0027)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for backend in backends:"},{"line_number":95,"context_line":"            mountpoint \u003d getattr(CONF, backend).cinder_mount_point_base"},{"line_number":96,"context_line":"            # This is currently designed for cinder nfs backend only."},{"line_number":97,"context_line":"            # Later can be modified to work with other *fs backends."}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_f46ee7fd","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":32},"updated":"2020-04-30 07:34:00.000000000","message":"this should be inside if condition defined at line #94,\n\nalso provide appropriate comments wherever possible","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f0c82ace93ba8867d0ca4e595755dcdf55f918ac","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            else:"},{"line_number":92,"context_line":"                backends.append(\u0027glance_store\u0027)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for backend in backends:"},{"line_number":95,"context_line":"            mountpoint \u003d getattr(CONF, backend).cinder_mount_point_base"},{"line_number":96,"context_line":"            # This is currently designed for cinder nfs backend only."},{"line_number":97,"context_line":"            # Later can be modified to work with other *fs backends."}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_03dcf743","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":32},"in_reply_to":"1f493fa4_f46ee7fd","updated":"2020-04-30 10:55:53.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":91,"context_line":"            else:"},{"line_number":92,"context_line":"                backends.append(\u0027glance_store\u0027)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for backend in backends:"},{"line_number":95,"context_line":"            mountpoint \u003d getattr(CONF, backend).cinder_mount_point_base"},{"line_number":96,"context_line":"            # This is currently designed for cinder nfs backend only."},{"line_number":97,"context_line":"            # Later can be modified to work with other *fs backends."}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_a30b838b","line":94,"range":{"start_line":94,"start_character":8,"end_line":94,"end_character":32},"in_reply_to":"1f493fa4_f46ee7fd","updated":"2020-04-30 11:35:02.000000000","message":"This is line 94 so not sure what you are thinking of.","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fa965cf5cf87af4bbd64e9495c53479efe3e29d7","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                dirs, __ \u003d processutils.execute(\u0027ls %s\u0027 % mountpoint,"},{"line_number":105,"context_line":"                                                shell\u003dTrue)"},{"line_number":106,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_d79dadbc","line":109,"range":{"start_line":107,"start_character":16,"end_line":109,"end_character":60},"updated":"2020-04-30 07:34:00.000000000","message":"Should we log this as debug, as we are not failing/breaking execution here?","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f0c82ace93ba8867d0ca4e595755dcdf55f918ac","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                dirs, __ \u003d processutils.execute(\u0027ls %s\u0027 % mountpoint,"},{"line_number":105,"context_line":"                                                shell\u003dTrue)"},{"line_number":106,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_e3de2b3c","line":109,"range":{"start_line":107,"start_character":16,"end_line":109,"end_character":60},"in_reply_to":"1f493fa4_d79dadbc","updated":"2020-04-30 10:55:53.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fa965cf5cf87af4bbd64e9495c53479efe3e29d7","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"},{"line_number":113,"context_line":"            for dir in dirs:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_14455370","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":31},"updated":"2020-04-30 07:34:00.000000000","message":"If exception occurs at line 106, then this line will throw error \u0027dirs\u0027 used before assignment","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f0c82ace93ba8867d0ca4e595755dcdf55f918ac","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"},{"line_number":113,"context_line":"            for dir in dirs:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_43e9dfe3","line":110,"range":{"start_line":110,"start_character":12,"end_line":110,"end_character":31},"in_reply_to":"1f493fa4_14455370","updated":"2020-04-30 10:55:53.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            # generalizing this will be done in a later refactoring"},{"line_number":101,"context_line":"            rootwrap \u003d getattr(CONF, backend).rootwrap_config"},{"line_number":102,"context_line":"            rootwrap \u003d (\u0027sudo glance-rootwrap %s\u0027 % rootwrap)"},{"line_number":103,"context_line":"            try:"},{"line_number":104,"context_line":"                dirs, __ \u003d processutils.execute(\u0027ls %s\u0027 % mountpoint,"},{"line_number":105,"context_line":"                                                shell\u003dTrue)"},{"line_number":106,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"},{"line_number":113,"context_line":"            for dir in dirs:"},{"line_number":114,"context_line":"                dir \u003d os.path.join(mountpoint, dir)"},{"line_number":115,"context_line":"                with self.get_state() as mount_state:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_2322d3b9","line":112,"range":{"start_line":103,"start_character":2,"end_line":112,"end_character":22},"updated":"2020-04-30 11:35:02.000000000","message":"I think we should be able to replace all this L#103-112 with:\n\nif os.path.isdir(mountpoint):\n    dirs \u003d os.listdir(mountpoint)\nelse:\n    continue\n\ninstead of going through processutils and invoking shell and then doing string operation on top of that.\n\nAlso this return on line 112 stops our iteration and potentially leaves mountpoints unchecked.\n\nMight want to do sanitization of only dirs on that list in case there is other files in the mount base.","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            # generalizing this will be done in a later refactoring"},{"line_number":101,"context_line":"            rootwrap \u003d getattr(CONF, backend).rootwrap_config"},{"line_number":102,"context_line":"            rootwrap \u003d (\u0027sudo glance-rootwrap %s\u0027 % rootwrap)"},{"line_number":103,"context_line":"            try:"},{"line_number":104,"context_line":"                dirs, __ \u003d processutils.execute(\u0027ls %s\u0027 % mountpoint,"},{"line_number":105,"context_line":"                                                shell\u003dTrue)"},{"line_number":106,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":107,"context_line":"                LOG.error(_LE(\"Mountpoint %(mount)s path doesn\u0027t exist: \""},{"line_number":108,"context_line":"                              \"%(reason)s\"), {\u0027mount\u0027: mountpoint,"},{"line_number":109,"context_line":"                                              \u0027reason\u0027: ex})"},{"line_number":110,"context_line":"            dirs \u003d dirs.split()"},{"line_number":111,"context_line":"            if not dirs:"},{"line_number":112,"context_line":"                return"},{"line_number":113,"context_line":"            for dir in dirs:"},{"line_number":114,"context_line":"                dir \u003d os.path.join(mountpoint, dir)"},{"line_number":115,"context_line":"                with self.get_state() as mount_state:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_ea3b9b34","line":112,"range":{"start_line":103,"start_character":2,"end_line":112,"end_character":22},"in_reply_to":"1f493fa4_2322d3b9","updated":"2020-04-30 13:16:44.000000000","message":"Done\nSo there are 2 things here:\n1) We don\u0027t recommend using the mount point directory for any personal file/directories\n2) The rmdir will return NotADirectoryError for files so that will be logged but won\u0027t be deleted anyway so we\u0027re safe here","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                dir \u003d os.path.join(mountpoint, dir)"},{"line_number":115,"context_line":"                with self.get_state() as mount_state:"},{"line_number":116,"context_line":"                    if os.path.exists(dir) and not os.path.ismount(dir):"},{"line_number":117,"context_line":"                        try:"},{"line_number":118,"context_line":"                            processutils.execute(\u0027rmdir\u0027, dir)"},{"line_number":119,"context_line":"                        except processutils.ProcessExecutionError as ex:"},{"line_number":120,"context_line":"                            LOG.error(_LE("},{"line_number":121,"context_line":"                                \"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":122,"context_line":"                                \"%(reason)s\"),"},{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_a758ae30","line":124,"range":{"start_line":117,"start_character":0,"end_line":124,"end_character":47},"updated":"2020-04-30 11:35:02.000000000","message":"Ditto we could replace this with simple `os.rmdir(dir)`","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fa965cf5cf87af4bbd64e9495c53479efe3e29d7","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                        try:"},{"line_number":118,"context_line":"                            processutils.execute(\u0027rmdir\u0027, dir)"},{"line_number":119,"context_line":"                        except processutils.ProcessExecutionError as ex:"},{"line_number":120,"context_line":"                            LOG.error(_LE("},{"line_number":121,"context_line":"                                \"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":122,"context_line":"                                \"%(reason)s\"),"},{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_b7a0e1f5","line":124,"range":{"start_line":120,"start_character":28,"end_line":124,"end_character":47},"updated":"2020-04-30 07:34:00.000000000","message":"ditto","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                dir \u003d os.path.join(mountpoint, dir)"},{"line_number":115,"context_line":"                with self.get_state() as mount_state:"},{"line_number":116,"context_line":"                    if os.path.exists(dir) and not os.path.ismount(dir):"},{"line_number":117,"context_line":"                        try:"},{"line_number":118,"context_line":"                            processutils.execute(\u0027rmdir\u0027, dir)"},{"line_number":119,"context_line":"                        except processutils.ProcessExecutionError as ex:"},{"line_number":120,"context_line":"                            LOG.error(_LE("},{"line_number":121,"context_line":"                                \"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":122,"context_line":"                                \"%(reason)s\"),"},{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_ea527b66","line":124,"range":{"start_line":117,"start_character":0,"end_line":124,"end_character":47},"in_reply_to":"1f493fa4_a758ae30","updated":"2020-04-30 13:16:44.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f0c82ace93ba8867d0ca4e595755dcdf55f918ac","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                        try:"},{"line_number":118,"context_line":"                            processutils.execute(\u0027rmdir\u0027, dir)"},{"line_number":119,"context_line":"                        except processutils.ProcessExecutionError as ex:"},{"line_number":120,"context_line":"                            LOG.error(_LE("},{"line_number":121,"context_line":"                                \"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":122,"context_line":"                                \"%(reason)s\"),"},{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_83ef67e7","line":124,"range":{"start_line":120,"start_character":28,"end_line":124,"end_character":47},"in_reply_to":"1f493fa4_b7a0e1f5","updated":"2020-04-30 10:55:53.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"fa965cf5cf87af4bbd64e9495c53479efe3e29d7","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    @contextlib.contextmanager"},{"line_number":129,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_f771c9a9","line":126,"updated":"2020-04-30 07:34:00.000000000","message":"This entire code block from line #85 to #126 needs to be arranged properly and should be commenting so that reviewer will get idea what exactly is happening here.","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    @contextlib.contextmanager"},{"line_number":129,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_8af2d76e","line":126,"in_reply_to":"1f493fa4_e7abd6d2","updated":"2020-04-30 13:16:44.000000000","message":"The lock is used when we delete records in the existing attachments in the memory to avoid races.\nIn this case, since there are no attachments, it will just log it and continue with the unmounting (if mounted)","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    @contextlib.contextmanager"},{"line_number":129,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_e7abd6d2","line":126,"in_reply_to":"1f493fa4_f771c9a9","updated":"2020-04-30 11:35:02.000000000","message":"Doesn\u0027t this L#126 fail when it hits L#213 and the mountpoint doesn\u0027t exists in the mountpoints that we were already tracking?","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"f0c82ace93ba8867d0ca4e595755dcdf55f918ac","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                                {\u0027mountpoint\u0027: mountpoint,"},{"line_number":124,"context_line":"                                 \u0027reason\u0027: ex})"},{"line_number":125,"context_line":"                    else:"},{"line_number":126,"context_line":"                        mount_state.umount(None, dir, HOST, rootwrap)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    @contextlib.contextmanager"},{"line_number":129,"context_line":"    def get_state(self):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_63ea1bd8","line":126,"in_reply_to":"1f493fa4_f771c9a9","updated":"2020-04-30 10:55:53.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                LOG.debug(\u0027Mounting %(mountpoint)s\u0027,"},{"line_number":249,"context_line":"                          {\u0027mountpoint\u0027: mountpoint})"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"                processutils.execute(\u0027mkdir\u0027, \u0027-p\u0027, mountpoint)"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"                mount_cmd \u003d [\u0027mount\u0027, \u0027-t\u0027, fstype]"},{"line_number":254,"context_line":"                if options is not None:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_4790ca95","line":251,"updated":"2020-04-30 11:35:02.000000000","message":"And this could be replaced with os.makedirs()","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                LOG.debug(\u0027Mounting %(mountpoint)s\u0027,"},{"line_number":249,"context_line":"                          {\u0027mountpoint\u0027: mountpoint})"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"                processutils.execute(\u0027mkdir\u0027, \u0027-p\u0027, mountpoint)"},{"line_number":252,"context_line":""},{"line_number":253,"context_line":"                mount_cmd \u003d [\u0027mount\u0027, \u0027-t\u0027, fstype]"},{"line_number":254,"context_line":"                if options is not None:"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_cae85f7d","line":251,"in_reply_to":"1f493fa4_4790ca95","updated":"2020-04-30 13:16:44.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"6311b166123b429c1ed9384bc5a2f8a6b59099ef","unresolved":false,"context_lines":[{"line_number":340,"context_line":""},{"line_number":341,"context_line":"        if not os.path.ismount(mountpoint):"},{"line_number":342,"context_line":"            try:"},{"line_number":343,"context_line":"                processutils.execute(\u0027rmdir\u0027, mountpoint)"},{"line_number":344,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":345,"context_line":"                LOG.error(_LE(\"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":346,"context_line":"                              \"%(reason)s\"),"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_27b2de49","line":343,"updated":"2020-04-30 11:35:02.000000000","message":"ditto os.rmdir maybe?","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"8c6df0c71021087815a032c8e0947f883a7cbef5","unresolved":false,"context_lines":[{"line_number":340,"context_line":""},{"line_number":341,"context_line":"        if not os.path.ismount(mountpoint):"},{"line_number":342,"context_line":"            try:"},{"line_number":343,"context_line":"                processutils.execute(\u0027rmdir\u0027, mountpoint)"},{"line_number":344,"context_line":"            except processutils.ProcessExecutionError as ex:"},{"line_number":345,"context_line":"                LOG.error(_LE(\"Couldn\u0027t remove directory %(mountpoint)s: \""},{"line_number":346,"context_line":"                              \"%(reason)s\"),"}],"source_content_type":"text/x-python","patch_set":13,"id":"1f493fa4_aaeb5375","line":343,"in_reply_to":"1f493fa4_27b2de49","updated":"2020-04-30 13:16:44.000000000","message":"Done","commit_id":"195b9c34091d6545119de18998a8c7b683190b4c"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f0f449038ed4c23b938145faa836981ea53147c5","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import collections"},{"line_number":14,"context_line":"import contextlib"},{"line_number":15,"context_line":"import logging"},{"line_number":16,"context_line":"import os.path"},{"line_number":17,"context_line":"import socket"},{"line_number":18,"context_line":"import threading"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_6d896573","line":15,"updated":"2020-04-30 13:28:55.000000000","message":"Need to import os here","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a632b6ea02ddc9c44072edb413fcc14be250d2b6","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"import collections"},{"line_number":14,"context_line":"import contextlib"},{"line_number":15,"context_line":"import logging"},{"line_number":16,"context_line":"import os.path"},{"line_number":17,"context_line":"import socket"},{"line_number":18,"context_line":"import threading"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_2dbf5daa","line":15,"in_reply_to":"1f493fa4_6d896573","updated":"2020-04-30 13:40:41.000000000","message":"Done","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f0f449038ed4c23b938145faa836981ea53147c5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                    dirs \u003d os.listdir(mountpoint)"},{"line_number":108,"context_line":"                else:"},{"line_number":109,"context_line":"                    continue"},{"line_number":110,"context_line":"                dirs \u003d dirs.split()"},{"line_number":111,"context_line":"                if not dirs:"},{"line_number":112,"context_line":"                    return"},{"line_number":113,"context_line":"                for dir in dirs:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_8d867165","line":110,"range":{"start_line":110,"start_character":0,"end_line":110,"end_character":35},"updated":"2020-04-30 13:28:55.000000000","message":"This shouldn\u0027t work/be needed as the os.listdir returns list, not a string.","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a632b6ea02ddc9c44072edb413fcc14be250d2b6","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                    dirs \u003d os.listdir(mountpoint)"},{"line_number":108,"context_line":"                else:"},{"line_number":109,"context_line":"                    continue"},{"line_number":110,"context_line":"                dirs \u003d dirs.split()"},{"line_number":111,"context_line":"                if not dirs:"},{"line_number":112,"context_line":"                    return"},{"line_number":113,"context_line":"                for dir in dirs:"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_0dcee161","line":110,"range":{"start_line":110,"start_character":0,"end_line":110,"end_character":35},"in_reply_to":"1f493fa4_8d867165","updated":"2020-04-30 13:40:41.000000000","message":"Done","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"f0f449038ed4c23b938145faa836981ea53147c5","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                            try:"},{"line_number":120,"context_line":"                                os.rmdir(dir)"},{"line_number":121,"context_line":"                            except Exception as ex:"},{"line_number":122,"context_line":"                                LOG.debug(_LE("},{"line_number":123,"context_line":"                                    \"Couldn\u0027t remove directory\""},{"line_number":124,"context_line":"                                    \"%(mountpoint)s: %(reason)s\"),"},{"line_number":125,"context_line":"                                    {\u0027mountpoint\u0027: mountpoint,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_8deb1111","line":122,"range":{"start_line":122,"start_character":42,"end_line":122,"end_character":46},"updated":"2020-04-30 13:28:55.000000000","message":"no translations for debug messages","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"a632b6ea02ddc9c44072edb413fcc14be250d2b6","unresolved":false,"context_lines":[{"line_number":119,"context_line":"                            try:"},{"line_number":120,"context_line":"                                os.rmdir(dir)"},{"line_number":121,"context_line":"                            except Exception as ex:"},{"line_number":122,"context_line":"                                LOG.debug(_LE("},{"line_number":123,"context_line":"                                    \"Couldn\u0027t remove directory\""},{"line_number":124,"context_line":"                                    \"%(mountpoint)s: %(reason)s\"),"},{"line_number":125,"context_line":"                                    {\u0027mountpoint\u0027: mountpoint,"}],"source_content_type":"text/x-python","patch_set":15,"id":"1f493fa4_edc8d555","line":122,"range":{"start_line":122,"start_character":42,"end_line":122,"end_character":46},"in_reply_to":"1f493fa4_8deb1111","updated":"2020-04-30 13:40:41.000000000","message":"Done","commit_id":"d6176c2bedd77f37972bbd45eb1b3f1743083272"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6f18128d9942be02675b53bf406d0223de2c81d8","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        # and use_count will eventually reach zero."},{"line_number":75,"context_line":"        # We do this to avoid a race between _HostMountState initialisation"},{"line_number":76,"context_line":"        # and an on-going mount/unmount operation"},{"line_number":77,"context_line":"        self.host \u003d host"},{"line_number":78,"context_line":"        while self.use_count !\u003d 0:"},{"line_number":79,"context_line":"            self.cond.wait()"},{"line_number":80,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"1f493fa4_5034fedd","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":24},"updated":"2020-04-30 15:14:58.000000000","message":"NIT:\nwe don\u0027t required this as we have global HOST defined.\nJust to note so that we can get rid of this in refactoring during V cycle","commit_id":"3e33cfad394afc6a6b5183fac45e7919c8a95d52"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6f18128d9942be02675b53bf406d0223de2c81d8","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                    dirs \u003d os.listdir(mountpoint)"},{"line_number":108,"context_line":"                else:"},{"line_number":109,"context_line":"                    continue"},{"line_number":110,"context_line":"                if not dirs:"},{"line_number":111,"context_line":"                    return"},{"line_number":112,"context_line":"                for dir in dirs:"},{"line_number":113,"context_line":"                    # for every directory in the mountpath, we"},{"line_number":114,"context_line":"                    # unmount it (if mounted) and remove it"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f493fa4_0d2701cc","line":111,"range":{"start_line":110,"start_character":16,"end_line":111,"end_character":26},"updated":"2020-04-30 15:14:58.000000000","message":"nit:\nNot required","commit_id":"3e33cfad394afc6a6b5183fac45e7919c8a95d52"}],"glance_store/exceptions.py":[{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"fb046f483fb71d6906e29a1d5f163b38ebace347","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                \"the backend store outside of Glance.\")"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class HostNotInitialized(GlanceStoreException):"},{"line_number":187,"context_line":"    message \u003d _(\"Current host %(host)s isn\u0027t initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f4c43b2_8a188975","line":187,"range":{"start_line":186,"start_character":0,"end_line":187,"end_character":59},"updated":"2020-04-17 15:41:02.000000000","message":"This is very ambiguous and gives no indication regarding why it was raised.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"d3aa649fbd518b8c0b1af7120142ba167daa48e8","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                \"the backend store outside of Glance.\")"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class HostNotInitialized(GlanceStoreException):"},{"line_number":187,"context_line":"    message \u003d _(\"Current host %(host)s isn\u0027t initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_08b68afb","line":187,"range":{"start_line":186,"start_character":0,"end_line":187,"end_character":59},"in_reply_to":"3f4c43b2_8a188975","updated":"2020-04-22 10:25:24.000000000","message":"Done","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b5f39afada2abff3d1859f54223712e867641517","unresolved":false,"context_lines":[{"line_number":183,"context_line":"                \"the backend store outside of Glance.\")"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"class HostNotInitialized(GlanceStoreException):"},{"line_number":187,"context_line":"    message \u003d _(\"Current host %(host)s isn\u0027t initialized.\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f493fa4_a5bd0b6a","line":187,"range":{"start_line":186,"start_character":0,"end_line":187,"end_character":59},"in_reply_to":"3f4c43b2_8a188975","updated":"2020-04-21 20:08:10.000000000","message":"Will update the message.","commit_id":"99e034a15f4adf1007a9a39ecccc24c430af28d4"}],"glance_store/tests/unit/test_fs_mount.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"265f20b41e87d11e0c73db7463569ed206685723","unresolved":false,"context_lines":[{"line_number":12,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"import fixtures"},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from oslo_concurrency import processutils"},{"line_number":19,"context_line":"from oslotest import base"}],"source_content_type":"text/x-python","patch_set":10,"id":"1f493fa4_d16ca79d","line":16,"range":{"start_line":15,"start_character":0,"end_line":16,"end_character":11},"updated":"2020-04-29 18:27:03.000000000","message":"These are both third party imports, so they should be with the oslo* imports below. But mock should be replaced by unittest.mock, which is a standard library import that would be in its own group here.","commit_id":"87966ce11fcb4475e790be117f052d5509518bb8"}]}
