)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2417,"name":"Ben Swartzlander","email":"ben@swartzlander.org","username":"bswartz"},"change_message_id":"645147068daff7ace5d2277b316ab5eb95407215","unresolved":false,"context_lines":[{"line_number":11,"context_line":"- Add appropriate tempest tests"},{"line_number":12,"context_line":"- Update generic driver documentation"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Partially implements bp share-shrink-api"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I256db947b65f66dfe514e0c0b350c1949da7f7be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa32b979_6f0eab8d","line":14,"updated":"2015-06-23 19:11:34.000000000","message":"Please use a new BP for this change since the share-shrink-api BP is complete.","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"d04bd3c72d1a32aeb6b6c9916636a83359e9b38c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"- Add appropriate tempest tests"},{"line_number":12,"context_line":"- Update generic driver documentation"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Partially implements bp share-shrink-api"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I256db947b65f66dfe514e0c0b350c1949da7f7be"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa32b979_7e933501","line":14,"in_reply_to":"fa32b979_6f0eab8d","updated":"2015-06-26 11:30:53.000000000","message":"Done","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"}],"contrib/tempest/tempest/api/share/test_shares_actions.py":[{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"c3003df7afc14b214cb9edb6748233457f2187f2","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        # shrink share and wait for active status"},{"line_number":406,"context_line":"        self.shares_client.shrink_share(share[\u0027id\u0027], new_size)"},{"line_number":407,"context_line":"        self.shares_client.wait_for_share_status(share[\u0027id\u0027], \u0027available\u0027)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # check state and new size"},{"line_number":410,"context_line":"        share \u003d self.shares_client.get_share(share[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_ab0b3223","line":407,"updated":"2015-06-17 16:34:34.000000000","message":"Please use STATUS_AVAILABLE from constants.py","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f85f064c53447e067b2ff91edda2afca680d838c","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        # shrink share and wait for active status"},{"line_number":406,"context_line":"        self.shares_client.shrink_share(share[\u0027id\u0027], new_size)"},{"line_number":407,"context_line":"        self.shares_client.wait_for_share_status(share[\u0027id\u0027], \u0027available\u0027)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # check state and new size"},{"line_number":410,"context_line":"        share \u003d self.shares_client.get_share(share[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_e564e5b9","line":407,"in_reply_to":"fa32b979_ab0b3223","updated":"2015-06-18 08:58:00.000000000","message":"It\u0027s tempest test and it doesn\u0027t have access to constants.py module :)","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"6e7f6a30dd07a4fec208edb9333cdf04f3410b14","unresolved":false,"context_lines":[{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        # shrink share and wait for active status"},{"line_number":406,"context_line":"        self.shares_client.shrink_share(share[\u0027id\u0027], new_size)"},{"line_number":407,"context_line":"        self.shares_client.wait_for_share_status(share[\u0027id\u0027], \u0027available\u0027)"},{"line_number":408,"context_line":""},{"line_number":409,"context_line":"        # check state and new size"},{"line_number":410,"context_line":"        share \u003d self.shares_client.get_share(share[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_2515ede3","line":407,"in_reply_to":"fa32b979_e564e5b9","updated":"2015-06-18 09:16:04.000000000","message":"Ah. Right. Done","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"}],"contrib/tempest/tempest/config_share.py":[{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"0329cae435cc71025e9f4aa19dd341e12d0bc5bf","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                help\u003d\"Defines whether to run manage/unmanage tests or not. \""},{"line_number":114,"context_line":"                     \"These test may leave orphaned resources, so be careful \""},{"line_number":115,"context_line":"                     \"enabling this opt.\"),"},{"line_number":116,"context_line":"    cfg.BoolOpt(\"run_extend_tests\","},{"line_number":117,"context_line":"                default\u003dTrue,"},{"line_number":118,"context_line":"                help\u003d\"Defines whether to run share extend tests or not. \""},{"line_number":119,"context_line":"                     \"Disable this feature if used driver doesn\u0027t \""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_5c24230c","line":116,"updated":"2015-07-13 09:25:53.000000000","message":"What is the reason to move \"run_extend_tests\" here?","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bbe359cc875b28a02567d9edfb4cf4275b015f19","unresolved":false,"context_lines":[{"line_number":113,"context_line":"                help\u003d\"Defines whether to run manage/unmanage tests or not. \""},{"line_number":114,"context_line":"                     \"These test may leave orphaned resources, so be careful \""},{"line_number":115,"context_line":"                     \"enabling this opt.\"),"},{"line_number":116,"context_line":"    cfg.BoolOpt(\"run_extend_tests\","},{"line_number":117,"context_line":"                default\u003dTrue,"},{"line_number":118,"context_line":"                help\u003d\"Defines whether to run share extend tests or not. \""},{"line_number":119,"context_line":"                     \"Disable this feature if used driver doesn\u0027t \""}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_00495f31","line":116,"in_reply_to":"9a41bdd9_5c24230c","updated":"2015-07-20 15:11:48.000000000","message":"I groped this options to improve readability for people who will setup 3rd-party CI systems because it\u0027s easier to see all options related to driver capabilities in one place.","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"}],"doc/source/devref/generic_driver.rst":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"c5d720fcd42b00bce3f3f511c16c3ec44b4c0b02","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"- Liberty version adds a share shrink capability, but this capability is not"},{"line_number":90,"context_line":"  effective because generic driver shrinks only filesystem size and doesn\u0027t"},{"line_number":91,"context_line":"  shrink the size of Cinder volume."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"The :mod:`manila.share.drivers.generic` Module"},{"line_number":94,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3afb71cf_9f77729f","line":91,"updated":"2015-06-10 20:02:35.000000000","message":"Is this feature really useful with this limitation in the Generic driver?","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a96e0b20a1b761019fa07b419dd7b5a5da7cd523","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"- Liberty version adds a share shrink capability, but this capability is not"},{"line_number":90,"context_line":"  effective because generic driver shrinks only filesystem size and doesn\u0027t"},{"line_number":91,"context_line":"  shrink the size of Cinder volume."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"The :mod:`manila.share.drivers.generic` Module"},{"line_number":94,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3afb71cf_b8a6b3ab","line":91,"in_reply_to":"3afb71cf_9f77729f","updated":"2015-06-11 09:49:12.000000000","message":"Bad implementation covered with functional tests in the gate is better than no implementation because in this case we provide a reference implementation for 3rd-party drivers and could test their own implementations with functional tests in 3rd-party CI jobs.\n\nWithout this implementation, we cannot guarantee that our functional tests for share-shrink work properly.","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"12a5d4b3ef014bc42949c374b460f9d429668e89","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"- Liberty version adds a share shrink capability, but this capability is not"},{"line_number":90,"context_line":"  effective because generic driver shrinks only filesystem size and doesn\u0027t"},{"line_number":91,"context_line":"  shrink the size of Cinder volume."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"The :mod:`manila.share.drivers.generic` Module"},{"line_number":94,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":2,"id":"1af86dd1_06d8bc1c","line":91,"in_reply_to":"3afb71cf_b8a6b3ab","updated":"2015-06-11 22:02:24.000000000","message":"Ok.","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"949eb6765391c9cc6535c95ac0509a4e6b86f2ca","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"- Liberty version adds a share shrink capability, but this capability is not"},{"line_number":90,"context_line":"  effective because generic driver shrinks only filesystem size and doesn\u0027t"},{"line_number":91,"context_line":"  shrink the size of Cinder volume."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"The :mod:`manila.share.drivers.generic` Module"},{"line_number":94,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":9,"id":"9a41bdd9_18a7d50b","line":91,"updated":"2015-07-16 06:07:20.000000000","message":"This is just a little confusing because ...is not effective... initially makes me wonder if it is supposed to work or not.  Maybe a little easier to understand if simply s/, but this capability is not effective because generic/. The generic/","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bbe359cc875b28a02567d9edfb4cf4275b015f19","unresolved":false,"context_lines":[{"line_number":88,"context_line":""},{"line_number":89,"context_line":"- Liberty version adds a share shrink capability, but this capability is not"},{"line_number":90,"context_line":"  effective because generic driver shrinks only filesystem size and doesn\u0027t"},{"line_number":91,"context_line":"  shrink the size of Cinder volume."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"The :mod:`manila.share.drivers.generic` Module"},{"line_number":94,"context_line":"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3a50d1a3_80948f37","line":91,"in_reply_to":"9a41bdd9_18a7d50b","updated":"2015-07-20 15:11:48.000000000","message":"This doc is primarily addressed to administrators, who should be aware of limitations. That\u0027s why I put here \"this capability is not effective\".","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"}],"manila/share/drivers/generic.py":[{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"c5d720fcd42b00bce3f3f511c16c3ec44b4c0b02","unresolved":false,"context_lines":[{"line_number":865,"context_line":"    def _get_mounted_share_size(self, mount_path, server_details):"},{"line_number":866,"context_line":"        try:"},{"line_number":867,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":868,"context_line":"                mount_path, server_details, 1)"},{"line_number":869,"context_line":"        except Exception as e:"},{"line_number":870,"context_line":"            msg \u003d _(\"Cannot calculate size of share %(path)s : %(error)s\") % {"},{"line_number":871,"context_line":"                \u0027path\u0027: mount_path,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_df1cca6b","line":868,"updated":"2015-06-10 20:02:35.000000000","message":"Can you define constants for 1, 2, 3 as something like BLOCK_DEVICE_SIZE, USED_SPACE, and AVAILABLE_SPACE?","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a96e0b20a1b761019fa07b419dd7b5a5da7cd523","unresolved":false,"context_lines":[{"line_number":865,"context_line":"    def _get_mounted_share_size(self, mount_path, server_details):"},{"line_number":866,"context_line":"        try:"},{"line_number":867,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":868,"context_line":"                mount_path, server_details, 1)"},{"line_number":869,"context_line":"        except Exception as e:"},{"line_number":870,"context_line":"            msg \u003d _(\"Cannot calculate size of share %(path)s : %(error)s\") % {"},{"line_number":871,"context_line":"                \u0027path\u0027: mount_path,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_acfc35b8","line":868,"in_reply_to":"3afb71cf_df1cca6b","updated":"2015-06-11 09:49:12.000000000","message":"Done","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"c5d720fcd42b00bce3f3f511c16c3ec44b4c0b02","unresolved":false,"context_lines":[{"line_number":878,"context_line":"    def _get_consumed_space(self, mount_path, server_details):"},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":881,"context_line":"                mount_path, server_details, 2, block_size\u003d\u0027M\u0027) / 1024.0"},{"line_number":882,"context_line":"        except Exception as e:"},{"line_number":883,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":884,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_c47be1bc","line":881,"updated":"2015-06-10 20:02:35.000000000","message":"Please use units for 1024.0","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f312de0c8a4c72fc222a013878dd4f26e7cd292a","unresolved":false,"context_lines":[{"line_number":878,"context_line":"    def _get_consumed_space(self, mount_path, server_details):"},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":881,"context_line":"                mount_path, server_details, 2, block_size\u003d\u0027M\u0027) / 1024.0"},{"line_number":882,"context_line":"        except Exception as e:"},{"line_number":883,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":884,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_c8dbd64d","line":881,"in_reply_to":"3afb71cf_4dfb7847","updated":"2015-06-11 12:39:50.000000000","message":"I cannot understand how constants from oslo_utils/units.py can help with conversion Mb (int) -\u003e Gb (float)","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a96e0b20a1b761019fa07b419dd7b5a5da7cd523","unresolved":false,"context_lines":[{"line_number":878,"context_line":"    def _get_consumed_space(self, mount_path, server_details):"},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":881,"context_line":"                mount_path, server_details, 2, block_size\u003d\u0027M\u0027) / 1024.0"},{"line_number":882,"context_line":"        except Exception as e:"},{"line_number":883,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":884,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_fb0d45e8","line":881,"in_reply_to":"3afb71cf_c47be1bc","updated":"2015-06-11 09:49:12.000000000","message":"units library is not in openstack global requirements and Pint (which in requirements) is too heavy for this simple conversion.","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"12a5d4b3ef014bc42949c374b460f9d429668e89","unresolved":false,"context_lines":[{"line_number":878,"context_line":"    def _get_consumed_space(self, mount_path, server_details):"},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":881,"context_line":"                mount_path, server_details, 2, block_size\u003d\u0027M\u0027) / 1024.0"},{"line_number":882,"context_line":"        except Exception as e:"},{"line_number":883,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":884,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":2,"id":"1af86dd1_e67800fb","line":881,"in_reply_to":"3afb71cf_c8dbd64d","updated":"2015-06-11 22:02:24.000000000","message":"What I meant was you could use units.Ki to replace the hard-coded 1024 after you import it as in Andrew\u0027s example.","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":9366,"name":"Andrew Kerr","email":"andrew.kerr@netapp.com","username":"andrew-kerr"},"change_message_id":"f774d995fa4a2db673da88ef431cf6795524663d","unresolved":false,"context_lines":[{"line_number":878,"context_line":"    def _get_consumed_space(self, mount_path, server_details):"},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":881,"context_line":"                mount_path, server_details, 2, block_size\u003d\u0027M\u0027) / 1024.0"},{"line_number":882,"context_line":"        except Exception as e:"},{"line_number":883,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":884,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":2,"id":"3afb71cf_4dfb7847","line":881,"in_reply_to":"3afb71cf_fb0d45e8","updated":"2015-06-11 12:26:26.000000000","message":"I think she meant use oslo units\n\n from oslo_utils import units","commit_id":"a4f273e48df74291f751b87dd2fc24d4f527a488"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"c7a59082af05a5be3275b5fb9f4255029f896df9","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"BLOCK_DEVICE_SIZE \u003d 1"},{"line_number":91,"context_line":"USED_SPACE \u003d 2"},{"line_number":92,"context_line":"AVAILABLE_SPACE \u003d 3"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def ensure_server(f):"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_d3da8878","line":92,"updated":"2015-06-14 00:33:31.000000000","message":"AVAILABLE_SPACE is not be used?","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a489d0da09bcbc80e780aa567f217afdb4f8530f","unresolved":false,"context_lines":[{"line_number":89,"context_line":""},{"line_number":90,"context_line":"BLOCK_DEVICE_SIZE \u003d 1"},{"line_number":91,"context_line":"USED_SPACE \u003d 2"},{"line_number":92,"context_line":"AVAILABLE_SPACE \u003d 3"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"def ensure_server(f):"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_d306f21f","line":92,"in_reply_to":"fa32b979_d3da8878","updated":"2015-06-15 09:48:35.000000000","message":"Done","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"c7a59082af05a5be3275b5fb9f4255029f896df9","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        :param server_details: Share server connection details"},{"line_number":857,"context_line":"        :param index: Data index in df command output:"},{"line_number":858,"context_line":"            BLOCK_DEVICE_SIZE - Size of block device (example: 1G)"},{"line_number":859,"context_line":"            USED_SPACE - Used space (example: 1G)"},{"line_number":860,"context_line":"            AVAILABLE_SPACE - Available space (example: 1G)"},{"line_number":861,"context_line":"        :param block_size: size of block (example: G, M, Mib, etc)"},{"line_number":862,"context_line":"        :return:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_33e9741b","line":859,"updated":"2015-06-14 00:33:31.000000000","message":"Why \u0027USED_SPACE \u003d 2\u0027 means that \u0027(example: 1G)\u0027? Maybe it could be changed to 2G?","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a489d0da09bcbc80e780aa567f217afdb4f8530f","unresolved":false,"context_lines":[{"line_number":856,"context_line":"        :param server_details: Share server connection details"},{"line_number":857,"context_line":"        :param index: Data index in df command output:"},{"line_number":858,"context_line":"            BLOCK_DEVICE_SIZE - Size of block device (example: 1G)"},{"line_number":859,"context_line":"            USED_SPACE - Used space (example: 1G)"},{"line_number":860,"context_line":"            AVAILABLE_SPACE - Available space (example: 1G)"},{"line_number":861,"context_line":"        :param block_size: size of block (example: G, M, Mib, etc)"},{"line_number":862,"context_line":"        :return:"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_f303f60d","line":859,"in_reply_to":"fa32b979_33e9741b","updated":"2015-06-15 09:48:35.000000000","message":"Done","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":15100,"name":"zhongjun","email":"jun.zhongjun2@gmail.com","username":"zhongjun2"},"change_message_id":"c7a59082af05a5be3275b5fb9f4255029f896df9","unresolved":false,"context_lines":[{"line_number":857,"context_line":"        :param index: Data index in df command output:"},{"line_number":858,"context_line":"            BLOCK_DEVICE_SIZE - Size of block device (example: 1G)"},{"line_number":859,"context_line":"            USED_SPACE - Used space (example: 1G)"},{"line_number":860,"context_line":"            AVAILABLE_SPACE - Available space (example: 1G)"},{"line_number":861,"context_line":"        :param block_size: size of block (example: G, M, Mib, etc)"},{"line_number":862,"context_line":"        :return:"},{"line_number":863,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_f3f22c06","line":860,"updated":"2015-06-14 00:33:31.000000000","message":"Why \u0027AVAILABLE_SPACE \u003d 3\u0027 means that \u0027(example: 1G)\u0027?  Or it\u0027s only a reference？","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"a489d0da09bcbc80e780aa567f217afdb4f8530f","unresolved":false,"context_lines":[{"line_number":857,"context_line":"        :param index: Data index in df command output:"},{"line_number":858,"context_line":"            BLOCK_DEVICE_SIZE - Size of block device (example: 1G)"},{"line_number":859,"context_line":"            USED_SPACE - Used space (example: 1G)"},{"line_number":860,"context_line":"            AVAILABLE_SPACE - Available space (example: 1G)"},{"line_number":861,"context_line":"        :param block_size: size of block (example: G, M, Mib, etc)"},{"line_number":862,"context_line":"        :return:"},{"line_number":863,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa32b979_85049d15","line":860,"in_reply_to":"fa32b979_f3f22c06","updated":"2015-06-15 09:48:35.000000000","message":"Done","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"696dca4f173459f762ba7e98cef93b672a4fb8fb","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":885,"context_line":"                mount_path, server_details, USED_SPACE, block_size\u003d\u0027M\u0027)"},{"line_number":886,"context_line":"            size /\u003d 1024.0"},{"line_number":887,"context_line":"        except Exception as e:"},{"line_number":888,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":889,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af86dd1_86d5ccba","line":886,"updated":"2015-06-11 22:03:43.000000000","message":"Add this import in the beginning: from oslo_utils import units\n\nThen use units.Ki to replace 1024.","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"eab6d2ef41eeee2aa29a29c5253c4e7b7d663a1c","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":885,"context_line":"                mount_path, server_details, USED_SPACE, block_size\u003d\u0027M\u0027)"},{"line_number":886,"context_line":"            size /\u003d 1024.0"},{"line_number":887,"context_line":"        except Exception as e:"},{"line_number":888,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":889,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":3,"id":"1af86dd1_d10b6f7c","line":886,"in_reply_to":"1af86dd1_86d5ccba","updated":"2015-06-12 07:53:34.000000000","message":"In this case, it\u0027s a bad idea because it breaks the semantics of this code.\n\nYou propose me to do following:\n\nline 884-885: get used space in Megabytes \n\nline 886: divide Megabytes by Kilobytes ((float)units.Ki) ??????\n\n\nSo Your proposal looks odd.","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"3ecbd82ce6b483650a4f06c8b750c674063ab1a4","unresolved":false,"context_lines":[{"line_number":883,"context_line":"        try:"},{"line_number":884,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":885,"context_line":"                mount_path, server_details, USED_SPACE, block_size\u003d\u0027M\u0027)"},{"line_number":886,"context_line":"            size /\u003d 1024.0"},{"line_number":887,"context_line":"        except Exception as e:"},{"line_number":888,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":889,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba3cc151_232ff4a2","line":886,"in_reply_to":"1af86dd1_d10b6f7c","updated":"2015-06-29 00:42:32.000000000","message":"Just noticed that this is not addressed in the latest patch. Have you looked at units.py in oslo_utils?  Here is part of the code in there:\n\n\"\"\"\nUnit constants\n\"\"\"\n\n# Binary unit constants.\nKi \u003d 1024\nMi \u003d 1024 ** 2\nGi \u003d 1024 ** 3\nTi \u003d 1024 ** 4\nPi \u003d 1024 ** 5\nEi \u003d 1024 ** 6\nZi \u003d 1024 ** 7\nYi \u003d 1024 ** 8\n\nWhat I\u0027m suggesting is to use the existing constant Ki defined in units to replace the hard coded 1024.0. The result is the same.\n\nsize /\u003d units.Ki\n\nIf you do a search in manila code, this has been used in many places already.","commit_id":"4948922b2234c2f6d78ff63a2d88931882056ef7"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"c3003df7afc14b214cb9edb6748233457f2187f2","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":592,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_eb37fafc","line":591,"updated":"2015-06-17 16:34:34.000000000","message":"Hm. That looks racy to me. Between checking the consumed space and the resize2fs command consumed_space could be greater that new_size.\nAnd resize2fs has a \"-P\" switch to get the minimal possible size.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bff04c40f7e75523ae195855d93609a9adc80fc2","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":592,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_76408d07","line":591,"in_reply_to":"fa32b979_4529119d","updated":"2015-06-18 10:04:30.000000000","message":"Yes, mentioned case should be addressed, but proposed implementation is error-prone and complicated: \n\n1. We should add a lock here to guarantee that exports will not change via allow_access until we finish shrink operation.\n2. resize2fs -P returns size in BLOCKs not in Kb or Mb\n  2.1 From resize2fs man page:\n   KNOWN BUGS\n       The  minimum  size  of  the filesystem as estimated by resize2fs may be\n       incorrect, especially for filesystems with 1k and 2k blocksizes.\n  2.2 We will be forced to execute additional command like sudo blockdev --getbsz /dev/XXX to get block size\n  2.3 Result of manual calculation will be more inaccurate than result received from \u0027df\u0027 command\n\nThe more accurate solution is raising Invalid exception in _resize_filesystem() method, catch this exception in try-except block on line 598 and raise exception.ShareShrinkingPossibleDataLoss() exception.\n\nThe whole point of this implementation is NOT to provide efficient production-ready solution but for providing simple example of implementation of the shrink_share() driver method and to have example for tempest tests in gate (to guarantee that our tempest test are working and valid)","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"6e7f6a30dd07a4fec208edb9333cdf04f3410b14","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":592,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_4529119d","line":591,"in_reply_to":"fa32b979_673a1de9","updated":"2015-06-18 09:16:04.000000000","message":"I don\u0027t say we want to shink to minimal size. What I mean with racy is the following:\n\n1) you get \"consumed_space\" with \"df\". Let\u0027s say you get 1024 byte. And \"new_size\" is set to 2048 byte.\n2) somebody in a VM which has the share mounted now runs \"truncate -s 10K /mnt/the-mounted-share/foobar\"\n3) now the code runs the \"_resize_filesystem()\" function. This will not work because the size changed and now more space is consumed than \"new_size\"\n\nWhat you imo need to do is:\n\n1) disable the export (so users can\u0027t write and the \"consumed_space\" can\u0027t change)\n2) check that \"new_size\" is \u003e\u003d \"resize2fs -P\" (because in the end resize2fs decides if it\u0027s possible to resize. so use that command to get the minimal size instead of \"df\")\n3) unmount device\n4) resize the filesystem\n5) mount device\n6) enable exports","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"13287605f91d04f2c13875bb0dc0ea1501d17374","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":592,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_c7fbde77","line":591,"in_reply_to":"fa32b979_76408d07","updated":"2015-06-18 12:18:07.000000000","message":"I guess with \"add a lock\" you mean we set the allow_access to \"rw\", right? If so, that sounds good to me.\nAbout the resize2fs: I havn\u0027t seen the KNOW BUGS section. Thanks for mention it.\nAnd I know that the generic driver is not for production (btw. we should mention that in the docs) but we should at least try to make it as solid as possible.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f85f064c53447e067b2ff91edda2afca680d838c","unresolved":false,"context_lines":[{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""},{"line_number":591,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":592,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_673a1de9","line":591,"in_reply_to":"fa32b979_eb37fafc","updated":"2015-06-18 08:58:00.000000000","message":"That\u0027s not racy, it\u0027s required because we shrinking volume to SPECIFIED size and not to minimal :)\n\nAlso in this condition we have \u003e\u003d because we should deal with rounding magic \n( consider this example: https://gist.github.com/uglide/e875c01bcd9a866295c4 )","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"c3003df7afc14b214cb9edb6748233457f2187f2","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"        volume \u003d self._get_volume(self.admin_context, share[\u0027id\u0027])"},{"line_number":596,"context_line":"        self._unmount_device(share, server_details)"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"        try:"},{"line_number":599,"context_line":"            self._resize_filesystem(server_details, volume, new_size\u003dnew_size)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_ce000404","line":596,"updated":"2015-06-17 16:34:34.000000000","message":"I may misunderstand something here, but isn\u0027t the block-device the thing we export via i.e. NFS? So if it\u0027s unmounted, the user will see a empty directory. Shouldn\u0027t we disable the export locations before the device gets unmounted?","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f85f064c53447e067b2ff91edda2afca680d838c","unresolved":false,"context_lines":[{"line_number":593,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"        volume \u003d self._get_volume(self.admin_context, share[\u0027id\u0027])"},{"line_number":596,"context_line":"        self._unmount_device(share, server_details)"},{"line_number":597,"context_line":""},{"line_number":598,"context_line":"        try:"},{"line_number":599,"context_line":"            self._resize_filesystem(server_details, volume, new_size\u003dnew_size)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_915c437e","line":596,"in_reply_to":"fa32b979_ce000404","updated":"2015-06-18 08:58:00.000000000","message":"Experience for user will be the same - not available share and hi probability to lose some data, but I think in current case it looks like connection interruption, and in case of disabled export locations users get access denied errors, which is more strange. \n\nThe current behavior is documented and connection interruptions shouldn\u0027t be a surprise.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"c3003df7afc14b214cb9edb6748233457f2187f2","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        finally:"},{"line_number":604,"context_line":"            self._mount_device(share, server_details, volume)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _resize_filesystem(self, server_details, volume, new_size\u003dNone):"},{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_eea708bb","line":606,"updated":"2015-06-17 16:34:34.000000000","message":"What\u0027s the point of not adding the \"new_size\" parameter to the method? It\u0027s called \"_resize_filesystem\" so it should do a resize imo","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"13287605f91d04f2c13875bb0dc0ea1501d17374","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        finally:"},{"line_number":604,"context_line":"            self._mount_device(share, server_details, volume)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _resize_filesystem(self, server_details, volume, new_size\u003dNone):"},{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_c78c3edc","line":606,"in_reply_to":"fa32b979_1667c1b7","updated":"2015-06-18 12:18:07.000000000","message":"Thanks. Done","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"6e7f6a30dd07a4fec208edb9333cdf04f3410b14","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        finally:"},{"line_number":604,"context_line":"            self._mount_device(share, server_details, volume)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _resize_filesystem(self, server_details, volume, new_size\u003dNone):"},{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_657bf528","line":606,"in_reply_to":"fa32b979_51cd5b83","updated":"2015-06-18 09:16:04.000000000","message":"Yes. But in which case do you want to call it without the \"new_size\" ?","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bff04c40f7e75523ae195855d93609a9adc80fc2","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        finally:"},{"line_number":604,"context_line":"            self._mount_device(share, server_details, volume)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _resize_filesystem(self, server_details, volume, new_size\u003dNone):"},{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_1667c1b7","line":606,"in_reply_to":"fa32b979_657bf528","updated":"2015-06-18 10:04:30.000000000","message":"In case of share_extend() method","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f85f064c53447e067b2ff91edda2afca680d838c","unresolved":false,"context_lines":[{"line_number":603,"context_line":"        finally:"},{"line_number":604,"context_line":"            self._mount_device(share, server_details, volume)"},{"line_number":605,"context_line":""},{"line_number":606,"context_line":"    def _resize_filesystem(self, server_details, volume, new_size\u003dNone):"},{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_51cd5b83","line":606,"in_reply_to":"fa32b979_eea708bb","updated":"2015-06-18 08:58:00.000000000","message":"resize2fs has optional argument size (link http://linux.die.net/man/8/resize2fs) if this argument is provided, then resize2fs resizes filesystem to specified size if it possible.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"c3003df7afc14b214cb9edb6748233457f2187f2","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"},{"line_number":610,"context_line":"        command \u003d [\u0027sudo\u0027, \u0027resize2fs\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        if new_size:"},{"line_number":613,"context_line":"            command.append(\"%sG\" % six.text_type(new_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_4e7e341a","line":610,"updated":"2015-06-17 16:34:34.000000000","message":"I think the used FS should be checked. resize2fs can afaik only resize ext2+3+4.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f85f064c53447e067b2ff91edda2afca680d838c","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"},{"line_number":610,"context_line":"        command \u003d [\u0027sudo\u0027, \u0027resize2fs\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        if new_size:"},{"line_number":613,"context_line":"            command.append(\"%sG\" % six.text_type(new_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_d1d96b58","line":610,"in_reply_to":"fa32b979_4e7e341a","updated":"2015-06-18 08:58:00.000000000","message":"It\u0027s redundant because generic driver supports only ext4 + ext3 (See manila/share/drivers/generic.py:77)","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"6e7f6a30dd07a4fec208edb9333cdf04f3410b14","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        \"\"\"Resize filesystem of provided volume.\"\"\""},{"line_number":608,"context_line":"        check_command \u003d [\u0027sudo\u0027, \u0027fsck\u0027, \u0027-pf\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":609,"context_line":"        self._ssh_exec(server_details, check_command)"},{"line_number":610,"context_line":"        command \u003d [\u0027sudo\u0027, \u0027resize2fs\u0027, volume[\u0027mountpoint\u0027]]"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        if new_size:"},{"line_number":613,"context_line":"            command.append(\"%sG\" % six.text_type(new_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_e005b310","line":610,"in_reply_to":"fa32b979_d1d96b58","updated":"2015-06-18 09:16:04.000000000","message":"Ah. Right. thanks for the hint. Done.","commit_id":"d038858040bbe4a9fb945762affca868a0c39816"},{"author":{"_account_id":2417,"name":"Ben Swartzlander","email":"ben@swartzlander.org","username":"bswartz"},"change_message_id":"a5683794b2078c9e68300d1b07e18e4d733307fc","unresolved":false,"context_lines":[{"line_number":88,"context_line":"CONF.register_opts(share_opts)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"BLOCK_DEVICE_SIZE \u003d 1"},{"line_number":91,"context_line":"USED_SPACE \u003d 2"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def ensure_server(f):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_17d0d5c8","line":91,"updated":"2015-06-19 16:52:30.000000000","message":"These constants are very unclear. I would prefer renaming them to BLOCK_DEVICE_SIZE_INDEX and USED_SPACE_INDEX and adding a note that they refer to the column number in the \"df\" output.","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"d04bd3c72d1a32aeb6b6c9916636a83359e9b38c","unresolved":false,"context_lines":[{"line_number":88,"context_line":"CONF.register_opts(share_opts)"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"BLOCK_DEVICE_SIZE \u003d 1"},{"line_number":91,"context_line":"USED_SPACE \u003d 2"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"def ensure_server(f):"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_a102fc07","line":91,"in_reply_to":"fa32b979_17d0d5c8","updated":"2015-06-26 11:30:53.000000000","message":"Done","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"cf4e8fd2b85ffe157c4582e2232b5c23ce1268c2","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        mount_path \u003d helper.get_share_path_by_export_location("},{"line_number":585,"context_line":"            share_server[\u0027backend_details\u0027], export_location)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        consumed_space \u003d self._get_consumed_space(mount_path, server_details)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_87571625","line":587,"updated":"2015-06-18 12:19:27.000000000","message":"Some sort of lock is still missing before getting the \"consumed_space\"","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"5640095d0a098e83767a89d3c7c79ff8c3330922","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        mount_path \u003d helper.get_share_path_by_export_location("},{"line_number":585,"context_line":"            share_server[\u0027backend_details\u0027], export_location)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        consumed_space \u003d self._get_consumed_space(mount_path, server_details)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_951ad2c4","line":587,"in_reply_to":"fa32b979_87571625","updated":"2015-06-18 17:10:10.000000000","message":"Lock? You mean lock for changing data while calculating?","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"d04bd3c72d1a32aeb6b6c9916636a83359e9b38c","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        mount_path \u003d helper.get_share_path_by_export_location("},{"line_number":585,"context_line":"            share_server[\u0027backend_details\u0027], export_location)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        consumed_space \u003d self._get_consumed_space(mount_path, server_details)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_9e98791d","line":587,"in_reply_to":"fa32b979_89c37a8a","updated":"2015-06-26 11:30:53.000000000","message":"Done","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":7102,"name":"Thomas Bechtold","email":"thomas.bechtold@chainguard.dev","username":"toabctl"},"change_message_id":"d3d798aa65c4ed7a764a72788a4271e378b42b05","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        mount_path \u003d helper.get_share_path_by_export_location("},{"line_number":585,"context_line":"            share_server[\u0027backend_details\u0027], export_location)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        consumed_space \u003d self._get_consumed_space(mount_path, server_details)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_89c37a8a","line":587,"in_reply_to":"fa32b979_8b47f51c","updated":"2015-06-19 11:09:52.000000000","message":"@Valery: yes.\n@Igor: This still has the issue that somebody can write to the share while the underlying block device is unmounted. I would prefer to set the share to read only before doing the resize.","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"f830b1336574de93c0256b0d402d36fb079afb1b","unresolved":false,"context_lines":[{"line_number":584,"context_line":"        mount_path \u003d helper.get_share_path_by_export_location("},{"line_number":585,"context_line":"            share_server[\u0027backend_details\u0027], export_location)"},{"line_number":586,"context_line":""},{"line_number":587,"context_line":"        consumed_space \u003d self._get_consumed_space(mount_path, server_details)"},{"line_number":588,"context_line":""},{"line_number":589,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":590,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa32b979_8b47f51c","line":587,"in_reply_to":"fa32b979_951ad2c4","updated":"2015-06-19 09:16:18.000000000","message":"@Thomas,\nWe don\u0027t need this lock, see updated code on lines: 620-623","commit_id":"8a7dc0a8f7b0b06715ea9548396592c575e222d6"},{"author":{"_account_id":6491,"name":"xing-yang","email":"xingyang105@gmail.com","username":"xing-yang"},"change_message_id":"5bc81217ad8b61635d982c024a3c8b42cf041dd9","unresolved":false,"context_lines":[{"line_number":904,"context_line":"        try:"},{"line_number":905,"context_line":"            size \u003d self._get_mount_stats_by_index("},{"line_number":906,"context_line":"                mount_path, server_details, USED_SPACE_INDEX, block_size\u003d\u0027M\u0027)"},{"line_number":907,"context_line":"            size /\u003d 1024.0"},{"line_number":908,"context_line":"        except Exception as e:"},{"line_number":909,"context_line":"            msg \u003d _(\"Cannot calculate consumed space on share \""},{"line_number":910,"context_line":"                    \"%(path)s : %(error)s\") % {"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba3cc151_630c1c43","line":907,"updated":"2015-06-29 00:42:21.000000000","message":"Just noticed that my earlier comment was not addressed. I added explanation here:\n\nhttps://review.openstack.org/#/c/190037/3/manila/share/drivers/generic.py","commit_id":"552357272be8e4cce0a5cec4a795d81a8ee7c26e"},{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"593865d595b7001e269b4ff80863e4c23b6ecea0","unresolved":false,"context_lines":[{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":600,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":601,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":602,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_74028e40","line":599,"updated":"2015-07-11 07:07:50.000000000","message":"Wouldn\u0027t this work with \u003e instead of \u003e\u003d","commit_id":"8b3e3824be10ee90972364fcda9fd7158e2a9fed"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"796ed67170e8baaf94193af7a39550301173c225","unresolved":false,"context_lines":[{"line_number":596,"context_line":""},{"line_number":597,"context_line":"        LOG.debug(\"Consumed space on share: %s\", consumed_space)"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"        if consumed_space \u003e\u003d new_size:"},{"line_number":600,"context_line":"            raise exception.ShareShrinkingPossibleDataLoss("},{"line_number":601,"context_line":"                share_id\u003dshare[\u0027id\u0027])"},{"line_number":602,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_10a0c49e","line":599,"in_reply_to":"9a41bdd9_74028e40","updated":"2015-07-13 07:57:04.000000000","message":"We have here \u003e\u003d because we should deal with rounding magic in df command.","commit_id":"8b3e3824be10ee90972364fcda9fd7158e2a9fed"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"0329cae435cc71025e9f4aa19dd341e12d0bc5bf","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        try:"},{"line_number":631,"context_line":"            self._ssh_exec(server_details, command)"},{"line_number":632,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":633,"context_line":"            if e.stderr.find(\u0027New size smaller than minimum\u0027) !\u003d -1:"},{"line_number":634,"context_line":"                msg \u003d (_(\"Invalid \u0027new_size\u0027 provided: %s\")"},{"line_number":635,"context_line":"                       % six.text_type(new_size))"},{"line_number":636,"context_line":"                raise exception.Invalid(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_7c9fa703","line":633,"updated":"2015-07-13 09:25:53.000000000","message":"Why do you need to different exceptions here?\n\nSince logic based on error messages if fragile I suggest to remove it and raise just one exception here.","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bbe359cc875b28a02567d9edfb4cf4275b015f19","unresolved":false,"context_lines":[{"line_number":630,"context_line":"        try:"},{"line_number":631,"context_line":"            self._ssh_exec(server_details, command)"},{"line_number":632,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":633,"context_line":"            if e.stderr.find(\u0027New size smaller than minimum\u0027) !\u003d -1:"},{"line_number":634,"context_line":"                msg \u003d (_(\"Invalid \u0027new_size\u0027 provided: %s\")"},{"line_number":635,"context_line":"                       % six.text_type(new_size))"},{"line_number":636,"context_line":"                raise exception.Invalid(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_00ae3f2e","line":633,"in_reply_to":"9a41bdd9_7c9fa703","updated":"2015-07-20 15:11:48.000000000","message":"I need different exceptions here because handling logic is different in this cases (see lines 610-615).\nUnfortunately, \u0027resize2fs\u0027 command doesn\u0027t return different error codes, that\u0027s why I rely here on the error message, which is not so fragile in this case because system commands don\u0027t change frequently.","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"0329cae435cc71025e9f4aa19dd341e12d0bc5bf","unresolved":false,"context_lines":[{"line_number":960,"context_line":"        raise NotImplementedError()"},{"line_number":961,"context_line":""},{"line_number":962,"context_line":"    def disable_access_for_maintenance(self, server, share_name):"},{"line_number":963,"context_line":"        pass"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def restore_access_after_maintenance(self, server, share_name):"},{"line_number":966,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_9c72abe4","line":963,"updated":"2015-07-13 09:25:53.000000000","message":"Better to leave here docstring with info instead of \"pass\".","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bbe359cc875b28a02567d9edfb4cf4275b015f19","unresolved":false,"context_lines":[{"line_number":960,"context_line":"        raise NotImplementedError()"},{"line_number":961,"context_line":""},{"line_number":962,"context_line":"    def disable_access_for_maintenance(self, server, share_name):"},{"line_number":963,"context_line":"        pass"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def restore_access_after_maintenance(self, server, share_name):"},{"line_number":966,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_fb3ae4cc","line":963,"in_reply_to":"9a41bdd9_9c72abe4","updated":"2015-07-20 15:11:48.000000000","message":"Done","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"0329cae435cc71025e9f4aa19dd341e12d0bc5bf","unresolved":false,"context_lines":[{"line_number":963,"context_line":"        pass"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def restore_access_after_maintenance(self, server, share_name):"},{"line_number":966,"context_line":"        pass"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"    def _get_maintenance_file_path(self, share_name):"},{"line_number":969,"context_line":"        return os.path.join(self.configuration.share_mount_path,"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a41bdd9_7c448773","line":966,"updated":"2015-07-13 09:25:53.000000000","message":"ditto","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"bbe359cc875b28a02567d9edfb4cf4275b015f19","unresolved":false,"context_lines":[{"line_number":963,"context_line":"        pass"},{"line_number":964,"context_line":""},{"line_number":965,"context_line":"    def restore_access_after_maintenance(self, server, share_name):"},{"line_number":966,"context_line":"        pass"},{"line_number":967,"context_line":""},{"line_number":968,"context_line":"    def _get_maintenance_file_path(self, share_name):"},{"line_number":969,"context_line":"        return os.path.join(self.configuration.share_mount_path,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3a50d1a3_bb345cde","line":966,"in_reply_to":"9a41bdd9_7c448773","updated":"2015-07-20 15:11:48.000000000","message":"Done","commit_id":"e43c8a815d702fc8e7c717f3923ccc4b0bdf4d50"}],"manila/tests/share/drivers/test_generic.py":[{"author":{"_account_id":11047,"name":"Mark Sturdevant","email":"mark.sturdevant@ibm.com","username":"markstur"},"change_message_id":"593865d595b7001e269b4ff80863e4c23b6ecea0","unresolved":false,"context_lines":[{"line_number":1513,"context_line":"        self._driver._get_consumed_space.assert_called_once_with("},{"line_number":1514,"context_line":"            mock.ANY, server_details)"},{"line_number":1515,"context_line":"        self._driver._get_volume.assert_called_once_with(mock.ANY, share[\u0027id\u0027])"},{"line_number":1516,"context_line":"        self._driver._unmount_device.assert_called_once(share, server_details)"},{"line_number":1517,"context_line":"        self._driver._resize_filesystem("},{"line_number":1518,"context_line":"            server_details, vol, new_size\u003dsize)"},{"line_number":1519,"context_line":"        self._driver._mount_device(share, server_details, vol)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_f4c69e15","line":1516,"updated":"2015-07-11 07:07:50.000000000","message":"There is no assert_called_once().  Use _with.","commit_id":"8b3e3824be10ee90972364fcda9fd7158e2a9fed"},{"author":{"_account_id":14232,"name":"Igor Malinovskiy","email":"u.glide@gmail.com","username":"imalinovskiy"},"change_message_id":"796ed67170e8baaf94193af7a39550301173c225","unresolved":false,"context_lines":[{"line_number":1513,"context_line":"        self._driver._get_consumed_space.assert_called_once_with("},{"line_number":1514,"context_line":"            mock.ANY, server_details)"},{"line_number":1515,"context_line":"        self._driver._get_volume.assert_called_once_with(mock.ANY, share[\u0027id\u0027])"},{"line_number":1516,"context_line":"        self._driver._unmount_device.assert_called_once(share, server_details)"},{"line_number":1517,"context_line":"        self._driver._resize_filesystem("},{"line_number":1518,"context_line":"            server_details, vol, new_size\u003dsize)"},{"line_number":1519,"context_line":"        self._driver._mount_device(share, server_details, vol)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a41bdd9_905a9482","line":1516,"in_reply_to":"9a41bdd9_f4c69e15","updated":"2015-07-13 07:57:04.000000000","message":"Done","commit_id":"8b3e3824be10ee90972364fcda9fd7158e2a9fed"}]}
