)]}'
{"glance_store/_drivers/vmware_datastore.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        conn.close()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def get_datacenter_ref(session, datacenter_path):"},{"line_number":121,"context_line":"    search_index_moref \u003d session.vim.service_content.searchIndex"},{"line_number":122,"context_line":"    dc_moref \u003d session.invoke_api("},{"line_number":123,"context_line":"        session.vim,"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_4b02b5b4","line":120,"updated":"2015-02-26 09:37:40.000000000","message":"nit: Do we have any reason to make this two functions be global? IMO we\u0027d better put this two functions into Sore as two private methods.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        conn.close()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"def get_datacenter_ref(session, datacenter_path):"},{"line_number":121,"context_line":"    search_index_moref \u003d session.vim.service_content.searchIndex"},{"line_number":122,"context_line":"    dc_moref \u003d session.invoke_api("},{"line_number":123,"context_line":"        session.vim,"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_6511415d","line":120,"in_reply_to":"ba7be1f8_4b02b5b4","updated":"2015-03-02 09:38:47.000000000","message":"Done, it makes sense to move into Store class.\n\nOriginally, the methods were meant to be moved out into oslo.vmware, but then they are way too straightforward for any re-use by other projects.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        self.datacenter_path \u003d datacenter_path"},{"line_number":146,"context_line":"        self.weight \u003d weight"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def get_freespace(self, session):"},{"line_number":149,"context_line":"        return session.invoke_api(vim_util,"},{"line_number":150,"context_line":"                                  \u0027get_object_property\u0027,"},{"line_number":151,"context_line":"                                  session.vim,"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_f00ef48a","line":148,"updated":"2015-02-26 09:37:40.000000000","message":"I think this minor enhancement probably should be added in upstream - oslo.vmware lib: https://github.com/openstack/oslo.vmware/blob/master/oslo_vmware/objects/datastore.py#L31 , but, the freespace function need to be merged due to currently base Datastore need to give freespace field instead of query really.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":145,"context_line":"        self.datacenter_path \u003d datacenter_path"},{"line_number":146,"context_line":"        self.weight \u003d weight"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def get_freespace(self, session):"},{"line_number":149,"context_line":"        return session.invoke_api(vim_util,"},{"line_number":150,"context_line":"                                  \u0027get_object_property\u0027,"},{"line_number":151,"context_line":"                                  session.vim,"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_332bbdec","line":148,"in_reply_to":"ba7be1f8_f00ef48a","updated":"2015-03-02 09:38:47.000000000","message":"Agreed, I have removed this sub class and added a TODO item here in glance code. I will work on a patch asap and update the oslo_datastore object to return the freespace.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":319,"context_line":"                            \u0027datacenter_path:datastore_name:weight\u0027)"},{"line_number":320,"context_line":"                    LOG.error(msg)"},{"line_number":321,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":322,"context_line":"                        store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def configure(self):"},{"line_number":325,"context_line":"        self._sanity_check()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_652ec88d","line":322,"updated":"2015-02-26 09:37:40.000000000","message":"I prefer to add a check for duplicated configuration, raising a similar exception like https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/filesystem.py#L296","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":319,"context_line":"                            \u0027datacenter_path:datastore_name:weight\u0027)"},{"line_number":320,"context_line":"                    LOG.error(msg)"},{"line_number":321,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":322,"context_line":"                        store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def configure(self):"},{"line_number":325,"context_line":"        self._sanity_check()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_5e9faab4","line":322,"in_reply_to":"ba7be1f8_652ec88d","updated":"2015-03-02 09:38:47.000000000","message":"Done","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                    LOG.error(msg)"},{"line_number":321,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":322,"context_line":"                        store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def configure(self):"},{"line_number":325,"context_line":"        self._sanity_check()"},{"line_number":326,"context_line":"        self.scheme \u003d STORE_SCHEME"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_e5a71809","line":323,"updated":"2015-02-26 09:37:40.000000000","message":"And add a check for the case missing both option, e.g. https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/filesystem.py#L288","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                    LOG.error(msg)"},{"line_number":321,"context_line":"                    raise exceptions.BadStoreConfiguration("},{"line_number":322,"context_line":"                        store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"    def configure(self):"},{"line_number":325,"context_line":"        self._sanity_check()"},{"line_number":326,"context_line":"        self.scheme \u003d STORE_SCHEME"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_7ea46e08","line":323,"in_reply_to":"ba7be1f8_e5a71809","updated":"2015-03-02 09:38:47.000000000","message":"Done","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":365,"context_line":"            # vmware_datacenter_path."},{"line_number":366,"context_line":"            datacenter_path \u003d self.conf.glance_store.vmware_datacenter_path"},{"line_number":367,"context_line":"            datastore_name \u003d self._option_get(\u0027vmware_datastore_name\u0027)"},{"line_number":368,"context_line":"            datastores \u003d [\u0027%s:%s:%s\u0027 % (datacenter_path, datastore_name, 0)]"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        self.datastores \u003d self._build_datastore_weighted_map(datastores)"},{"line_number":371,"context_line":"        self.store_image_dir \u003d self.conf.glance_store.vmware_store_image_dir"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_c53a14e6","line":368,"updated":"2015-02-26 09:37:40.000000000","message":"So, and like filesystem driver, I think we\u0027d better allow operator uses a default weight, to make the option style be more consistent and operator life easier. E.g. https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/filesystem.py#L372","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":365,"context_line":"            # vmware_datacenter_path."},{"line_number":366,"context_line":"            datacenter_path \u003d self.conf.glance_store.vmware_datacenter_path"},{"line_number":367,"context_line":"            datastore_name \u003d self._option_get(\u0027vmware_datastore_name\u0027)"},{"line_number":368,"context_line":"            datastores \u003d [\u0027%s:%s:%s\u0027 % (datacenter_path, datastore_name, 0)]"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        self.datastores \u003d self._build_datastore_weighted_map(datastores)"},{"line_number":371,"context_line":"        self.store_image_dir \u003d self.conf.glance_store.vmware_store_image_dir"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_8dca9e18","line":368,"in_reply_to":"ba7be1f8_c53a14e6","updated":"2015-03-02 09:38:47.000000000","message":"Done, made it optional.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            datastore_name \u003d self._option_get(\u0027vmware_datastore_name\u0027)"},{"line_number":368,"context_line":"            datastores \u003d [\u0027%s:%s:%s\u0027 % (datacenter_path, datastore_name, 0)]"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        self.datastores \u003d self._build_datastore_weighted_map(datastores)"},{"line_number":371,"context_line":"        self.store_image_dir \u003d self.conf.glance_store.vmware_store_image_dir"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def select_datastore(self, image_size):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_70b84411","line":370,"updated":"2015-02-26 09:37:40.000000000","message":"If we assign self.datastores instead of update it, we don\u0027t need the line at line #289, imo, the stuff line #286-289 can be removed.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":367,"context_line":"            datastore_name \u003d self._option_get(\u0027vmware_datastore_name\u0027)"},{"line_number":368,"context_line":"            datastores \u003d [\u0027%s:%s:%s\u0027 % (datacenter_path, datastore_name, 0)]"},{"line_number":369,"context_line":""},{"line_number":370,"context_line":"        self.datastores \u003d self._build_datastore_weighted_map(datastores)"},{"line_number":371,"context_line":"        self.store_image_dir \u003d self.conf.glance_store.vmware_store_image_dir"},{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def select_datastore(self, image_size):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_b3016d3b","line":370,"in_reply_to":"ba7be1f8_70b84411","updated":"2015-03-02 09:38:47.000000000","message":"Just wanted to make sure the store object is in a consistent state :). IMO, I thought this is cleaner.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def select_datastore(self, image_size):"},{"line_number":374,"context_line":"        \"\"\"Select a datastore with free space larger than image size.\"\"\""},{"line_number":375,"context_line":"        for k, v in sorted(self.datastores.items(), reverse\u003dTrue):"},{"line_number":376,"context_line":"            max_fs \u003d v[0] if v else None"},{"line_number":377,"context_line":"            for ds in v:"},{"line_number":378,"context_line":"                ds_fs \u003d ds.get_freespace(self.session)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_90b938ce","line":375,"updated":"2015-02-26 09:37:40.000000000","message":"1. So I think we\u0027d better to keep weight field of each datastore in the option is digital, I see character can be sorted, but like your default value at #368, to keep sensible (I mean to prevent the weight value like \u0027a\u0027, \u0027b\u0027) in option and be consistent (I mean filesystem driver) is better. IMO, to add a similar check in _sanity_check(), and convert it to int value in _build_datastore_weighted_map().\n\n2. nit: I prefer to use six.iteritems() instead of dict.items() here.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":372,"context_line":""},{"line_number":373,"context_line":"    def select_datastore(self, image_size):"},{"line_number":374,"context_line":"        \"\"\"Select a datastore with free space larger than image size.\"\"\""},{"line_number":375,"context_line":"        for k, v in sorted(self.datastores.items(), reverse\u003dTrue):"},{"line_number":376,"context_line":"            max_fs \u003d v[0] if v else None"},{"line_number":377,"context_line":"            for ds in v:"},{"line_number":378,"context_line":"                ds_fs \u003d ds.get_freespace(self.session)"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_edda3ae8","line":375,"in_reply_to":"ba7be1f8_90b938ce","updated":"2015-03-02 09:38:47.000000000","message":"1. Done, I am now checking isdigit and converted to int value.\n\n2. Done. Thanks!","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            max_fs \u003d v[0] if v else None"},{"line_number":377,"context_line":"            for ds in v:"},{"line_number":378,"context_line":"                ds_fs \u003d ds.get_freespace(self.session)"},{"line_number":379,"context_line":"                ds.freespace \u003d ds_fs"},{"line_number":380,"context_line":"                if ds_fs \u003e max_fs.freespace:"},{"line_number":381,"context_line":"                    max_fs \u003d ds"},{"line_number":382,"context_line":"            if max_fs and max_fs.freespace \u003e\u003d image_size:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_d0fd706f","line":379,"updated":"2015-02-26 09:37:40.000000000","message":"So, again, I think to merge here Datastore into upstream version is a better way to go.\n\nIMHO, probably we can put this logic/line in to Datastore.__init__() , passing session object in __init__() is fine to me, but I\u0027m not sure if you/vmware folks has any ideas on this point.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":376,"context_line":"            max_fs \u003d v[0] if v else None"},{"line_number":377,"context_line":"            for ds in v:"},{"line_number":378,"context_line":"                ds_fs \u003d ds.get_freespace(self.session)"},{"line_number":379,"context_line":"                ds.freespace \u003d ds_fs"},{"line_number":380,"context_line":"                if ds_fs \u003e max_fs.freespace:"},{"line_number":381,"context_line":"                    max_fs \u003d ds"},{"line_number":382,"context_line":"            if max_fs and max_fs.freespace \u003e\u003d image_size:"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_0dd6aec3","line":379,"in_reply_to":"ba7be1f8_d0fd706f","updated":"2015-03-02 09:38:47.000000000","message":"Agreed, that is the idea. I have added a TODO item in glance code. I will work on a patch asap and update the oslo_datastore object to return the freespace.","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"203f041cc1a5ef0e3bd99711da6e467fb9bc6fdc","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                    max_fs \u003d ds"},{"line_number":382,"context_line":"            if max_fs and max_fs.freespace \u003e\u003d image_size:"},{"line_number":383,"context_line":"                return max_fs"},{"line_number":384,"context_line":"        msg \u003d _(\"No datastore found with enough free space to contain an \""},{"line_number":385,"context_line":"                \"image of size %d\") % image_size"},{"line_number":386,"context_line":"        LOG.error(msg)"},{"line_number":387,"context_line":"        raise exceptions.StorageFull()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_9098581d","line":384,"updated":"2015-02-26 09:37:40.000000000","message":"_() \u003d\u003e _LE()","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"af55151f5caee5df5bc311323cd27e989f45e829","unresolved":false,"context_lines":[{"line_number":381,"context_line":"                    max_fs \u003d ds"},{"line_number":382,"context_line":"            if max_fs and max_fs.freespace \u003e\u003d image_size:"},{"line_number":383,"context_line":"                return max_fs"},{"line_number":384,"context_line":"        msg \u003d _(\"No datastore found with enough free space to contain an \""},{"line_number":385,"context_line":"                \"image of size %d\") % image_size"},{"line_number":386,"context_line":"        LOG.error(msg)"},{"line_number":387,"context_line":"        raise exceptions.StorageFull()"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba7be1f8_ae402636","line":384,"in_reply_to":"ba7be1f8_9098581d","updated":"2015-03-02 09:38:47.000000000","message":"Ah, again..Thanks!","commit_id":"46b9e74ac1031b708d1ecb3940aa8a548278263e"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"a36f434b1ed9aa033a877ae2b0b779f2e7a742e5","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from oslo_utils import excutils"},{"line_number":26,"context_line":"from oslo_utils import units"},{"line_number":27,"context_line":"from oslo_vmware import api"},{"line_number":28,"context_line":"from oslo_vmware import constants"},{"line_number":29,"context_line":"from oslo_vmware.objects import datacenter as oslo_datacenter"},{"line_number":30,"context_line":"from oslo_vmware.objects import datastore as oslo_datastore"},{"line_number":31,"context_line":"from oslo_vmware import vim_util"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_237e016c","line":28,"updated":"2015-03-05 23:27:55.000000000","message":"Since oslo.vmware is an optional dependency, an import error needs to be caught here, or these imports need to be closer to their usage (i.e., inside a method). I realize the old ones weren\u0027t, but this is necessary. See also https://review.openstack.org/#/c/161428/ and https://review.openstack.org/#/c/161450/","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"afb484bbdb4e192638c44e8798fd792ca17d3a1d","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from oslo_utils import excutils"},{"line_number":26,"context_line":"from oslo_utils import units"},{"line_number":27,"context_line":"from oslo_vmware import api"},{"line_number":28,"context_line":"from oslo_vmware import constants"},{"line_number":29,"context_line":"from oslo_vmware.objects import datacenter as oslo_datacenter"},{"line_number":30,"context_line":"from oslo_vmware.objects import datastore as oslo_datastore"},{"line_number":31,"context_line":"from oslo_vmware import vim_util"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_b9c4de5f","line":28,"in_reply_to":"9a80dd14_237e016c","updated":"2015-03-06 09:23:11.000000000","message":"I do not think we need to catch import errors. Stevedore doesn\u0027t create an extension when it encounters an error loading a plugin defined in entry_points. Thus, in this case it wouldn\u0027t load the Store class due to import error.\n\nOn contrary, I feel catching the exception would make Stevedore load the extension and fail later during runtime. \n\nReference: https://github.com/dreamhost/stevedore/blob/master/stevedore/extension.py#L140","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"7073924e2101ca02b4167e517e4238adfe21a8c0","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from oslo_utils import excutils"},{"line_number":26,"context_line":"from oslo_utils import units"},{"line_number":27,"context_line":"from oslo_vmware import api"},{"line_number":28,"context_line":"from oslo_vmware import constants"},{"line_number":29,"context_line":"from oslo_vmware.objects import datacenter as oslo_datacenter"},{"line_number":30,"context_line":"from oslo_vmware.objects import datastore as oslo_datastore"},{"line_number":31,"context_line":"from oslo_vmware import vim_util"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_fc73714b","line":28,"in_reply_to":"9a80dd14_7d2f9f88","updated":"2015-03-06 23:16:10.000000000","message":"If the store is configured as such, the user should be installing oslo.vmware and so it won\u0027t break. But yes, that\u0027s the point. It should through a BadStoreConfiguration in that case and the user should be able to understand they need this dependency, as it is optional.\n\nCurrently the the current backends for glance do not /all/ follow this pattern but they should. Note that since vmware_datastore uses an optional dependency, it should be importable without that dependency.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"8356cd79538cd68bd07cd97ac1863c2919b1471a","unresolved":false,"context_lines":[{"line_number":25,"context_line":"from oslo_utils import excutils"},{"line_number":26,"context_line":"from oslo_utils import units"},{"line_number":27,"context_line":"from oslo_vmware import api"},{"line_number":28,"context_line":"from oslo_vmware import constants"},{"line_number":29,"context_line":"from oslo_vmware.objects import datacenter as oslo_datacenter"},{"line_number":30,"context_line":"from oslo_vmware.objects import datastore as oslo_datastore"},{"line_number":31,"context_line":"from oslo_vmware import vim_util"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_7d2f9f88","line":28,"in_reply_to":"9a80dd14_b9c4de5f","updated":"2015-03-06 10:25:43.000000000","message":"Clarification, I am only saying this won\u0027t break backend.register_opts as you mentioned in your https://review.openstack.org/#/c/161428/. It will surely break create_stores, if the store is configured in glance_store.store.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2c53e5c93dae19507376340ae5e5cb80f629e937","unresolved":false,"context_lines":[{"line_number":69,"context_line":"               help\u003d_(\u0027Inventory path to a datacenter. \u0027"},{"line_number":70,"context_line":"                      \u0027If the vmware_server_host specified is an ESX/ESXi, \u0027"},{"line_number":71,"context_line":"                      \u0027the vmware_datacenter_path is optional. If specified, \u0027"},{"line_number":72,"context_line":"                      \u0027it should be \"ha-datacenter\".\u0027)),"},{"line_number":73,"context_line":"    cfg.StrOpt(\u0027vmware_datastore_name\u0027,"},{"line_number":74,"context_line":"               help\u003d_(\u0027Datastore associated with the datacenter.\u0027)),"},{"line_number":75,"context_line":"    cfg.IntOpt(\u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_d18074c2","line":72,"updated":"2015-03-06 12:26:29.000000000","message":"do we want to add a deprecation warning for \u0027vmware_datacenter_path\u0027 and \u0027vmware_datastore_name\u0027 in this patch or we can do it in a separate one?","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"384318ff09bf49c48860823f8203a5c0814eead1","unresolved":false,"context_lines":[{"line_number":69,"context_line":"               help\u003d_(\u0027Inventory path to a datacenter. \u0027"},{"line_number":70,"context_line":"                      \u0027If the vmware_server_host specified is an ESX/ESXi, \u0027"},{"line_number":71,"context_line":"                      \u0027the vmware_datacenter_path is optional. If specified, \u0027"},{"line_number":72,"context_line":"                      \u0027it should be \"ha-datacenter\".\u0027)),"},{"line_number":73,"context_line":"    cfg.StrOpt(\u0027vmware_datastore_name\u0027,"},{"line_number":74,"context_line":"               help\u003d_(\u0027Datastore associated with the datacenter.\u0027)),"},{"line_number":75,"context_line":"    cfg.IntOpt(\u0027vmware_api_retry_count\u0027,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_b5dcb974","line":72,"in_reply_to":"9a80dd14_d18074c2","updated":"2015-03-06 20:09:58.000000000","message":"I was thinking to add a separate patch for it. Let me do it asap.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2c53e5c93dae19507376340ae5e5cb80f629e937","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            raise exceptions.BadStoreConfiguration("},{"line_number":283,"context_line":"                store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        if not (self.conf.glance_store.vmware_datastore_name"},{"line_number":286,"context_line":"                or self.conf.glance_store.vmware_datastores):"},{"line_number":287,"context_line":"            msg \u003d (_(\"Specify at least \u0027vmware_datastore_name\u0027 or \""},{"line_number":288,"context_line":"                     \"\u0027vmware_datastores\u0027 option\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_b12dc000","line":285,"updated":"2015-03-06 12:26:29.000000000","message":"nit: you can extract a variable for self.conf.glance_store to make these checks more readable","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"5b1f6fcf349c254dea808c5f106f28f17c25b621","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            raise exceptions.BadStoreConfiguration("},{"line_number":283,"context_line":"                store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        if not (self.conf.glance_store.vmware_datastore_name"},{"line_number":286,"context_line":"                or self.conf.glance_store.vmware_datastores):"},{"line_number":287,"context_line":"            msg \u003d (_(\"Specify at least \u0027vmware_datastore_name\u0027 or \""},{"line_number":288,"context_line":"                     \"\u0027vmware_datastores\u0027 option\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_e7667eec","line":285,"in_reply_to":"9a80dd14_3c918947","updated":"2015-03-06 23:37:42.000000000","message":"Ah, missed this comment. Will do.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":12000,"name":"Ian Cordasco","email":"sigmavirus24@gmail.com","username":"sigmavirus24"},"change_message_id":"7073924e2101ca02b4167e517e4238adfe21a8c0","unresolved":false,"context_lines":[{"line_number":282,"context_line":"            raise exceptions.BadStoreConfiguration("},{"line_number":283,"context_line":"                store_name\u003d\u0027vmware_datastore\u0027, reason\u003dmsg)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"        if not (self.conf.glance_store.vmware_datastore_name"},{"line_number":286,"context_line":"                or self.conf.glance_store.vmware_datastores):"},{"line_number":287,"context_line":"            msg \u003d (_(\"Specify at least \u0027vmware_datastore_name\u0027 or \""},{"line_number":288,"context_line":"                     \"\u0027vmware_datastores\u0027 option\"))"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_3c918947","line":285,"in_reply_to":"9a80dd14_b12dc000","updated":"2015-03-06 23:16:10.000000000","message":"+1","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2c53e5c93dae19507376340ae5e5cb80f629e937","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    ds_obj.datacenter \u003d dc_obj"},{"line_number":337,"context_line":"                    return ds_obj"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _get_freespace(self, ds_obj):"},{"line_number":340,"context_line":"        # TODO(sabari): Move this function into oslo_vmware\u0027s datastore object."},{"line_number":341,"context_line":"        return self.session.invoke_api("},{"line_number":342,"context_line":"            vim_util, \u0027get_object_property\u0027, self.session.vim, ds_obj.ref,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_0ce113fe","line":339,"updated":"2015-03-06 12:26:29.000000000","message":"the datastore object already has a property for the free space, why do we need this?","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"384318ff09bf49c48860823f8203a5c0814eead1","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    ds_obj.datacenter \u003d dc_obj"},{"line_number":337,"context_line":"                    return ds_obj"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _get_freespace(self, ds_obj):"},{"line_number":340,"context_line":"        # TODO(sabari): Move this function into oslo_vmware\u0027s datastore object."},{"line_number":341,"context_line":"        return self.session.invoke_api("},{"line_number":342,"context_line":"            vim_util, \u0027get_object_property\u0027, self.session.vim, ds_obj.ref,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_cbf0ae93","line":339,"in_reply_to":"9a80dd14_0ce113fe","updated":"2015-03-06 20:09:58.000000000","message":"Rado, the datastore object is initialized with the then freespace, but at the time of selection, we need to know the current freespace.\n\nThe right way is to move this method to oslo.vmware\u0027s datastore object. I will work on it after this patch.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"11150b0d089d40a9bdcdb76b4142a8f0b5d309b5","unresolved":false,"context_lines":[{"line_number":336,"context_line":"                    ds_obj.datacenter \u003d dc_obj"},{"line_number":337,"context_line":"                    return ds_obj"},{"line_number":338,"context_line":""},{"line_number":339,"context_line":"    def _get_freespace(self, ds_obj):"},{"line_number":340,"context_line":"        # TODO(sabari): Move this function into oslo_vmware\u0027s datastore object."},{"line_number":341,"context_line":"        return self.session.invoke_api("},{"line_number":342,"context_line":"            vim_util, \u0027get_object_property\u0027, self.session.vim, ds_obj.ref,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_4b802cc0","line":339,"in_reply_to":"9a80dd14_cbf0ae93","updated":"2015-03-07 16:18:28.000000000","message":"Ah, got it, thanks for the clarification.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2c53e5c93dae19507376340ae5e5cb80f629e937","unresolved":false,"context_lines":[{"line_number":342,"context_line":"            vim_util, \u0027get_object_property\u0027, self.session.vim, ds_obj.ref,"},{"line_number":343,"context_line":"            \u0027summary.freeSpace\u0027)"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def _get_datastore_info_and_weight(self, datastore):"},{"line_number":346,"context_line":"        weight \u003d 0"},{"line_number":347,"context_line":"        parts \u003d map(lambda x: x.strip(), datastore.rsplit(\":\", 2))"},{"line_number":348,"context_line":"        if len(parts) \u003c 2:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_ec24bf61","line":345,"updated":"2015-03-06 12:26:29.000000000","message":"_parse_datastore_info_and_weight will be a better name for this","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"384318ff09bf49c48860823f8203a5c0814eead1","unresolved":false,"context_lines":[{"line_number":342,"context_line":"            vim_util, \u0027get_object_property\u0027, self.session.vim, ds_obj.ref,"},{"line_number":343,"context_line":"            \u0027summary.freeSpace\u0027)"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"    def _get_datastore_info_and_weight(self, datastore):"},{"line_number":346,"context_line":"        weight \u003d 0"},{"line_number":347,"context_line":"        parts \u003d map(lambda x: x.strip(), datastore.rsplit(\":\", 2))"},{"line_number":348,"context_line":"        if len(parts) \u003c 2:"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_75cec1b5","line":345,"in_reply_to":"9a80dd14_ec24bf61","updated":"2015-03-06 20:09:58.000000000","message":"fair enough, done !","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2c53e5c93dae19507376340ae5e5cb80f629e937","unresolved":false,"context_lines":[{"line_number":345,"context_line":"    def _get_datastore_info_and_weight(self, datastore):"},{"line_number":346,"context_line":"        weight \u003d 0"},{"line_number":347,"context_line":"        parts \u003d map(lambda x: x.strip(), datastore.rsplit(\":\", 2))"},{"line_number":348,"context_line":"        if len(parts) \u003c 2:"},{"line_number":349,"context_line":"            msg \u003d _(\u0027vmware_datastores format must be \u0027"},{"line_number":350,"context_line":"                    \u0027datacenter_path:datastore_name:weight or \u0027"},{"line_number":351,"context_line":"                    \u0027datacenter_path:datastore_name\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_8cb42336","line":348,"updated":"2015-03-06 12:26:29.000000000","message":"why this is not part of _sanity_check() ?","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"384318ff09bf49c48860823f8203a5c0814eead1","unresolved":false,"context_lines":[{"line_number":345,"context_line":"    def _get_datastore_info_and_weight(self, datastore):"},{"line_number":346,"context_line":"        weight \u003d 0"},{"line_number":347,"context_line":"        parts \u003d map(lambda x: x.strip(), datastore.rsplit(\":\", 2))"},{"line_number":348,"context_line":"        if len(parts) \u003c 2:"},{"line_number":349,"context_line":"            msg \u003d _(\u0027vmware_datastores format must be \u0027"},{"line_number":350,"context_line":"                    \u0027datacenter_path:datastore_name:weight or \u0027"},{"line_number":351,"context_line":"                    \u0027datacenter_path:datastore_name\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a80dd14_f550f1d5","line":348,"in_reply_to":"9a80dd14_8cb42336","updated":"2015-03-06 20:09:58.000000000","message":"I added here because this requires parsing the parts of vmware_datastores. Eventually, all these checks will be executed as part of store.configure.","commit_id":"38372294e07bb039c8dac051b40fdd9c3b81f239"}],"tests/unit/test_vmware_store.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"10ada0245baced87e2f8fa133939685e07f1680f","unresolved":false,"context_lines":[{"line_number":394,"context_line":"        self.assertEqual(\u0027a\u0027, parts[0])"},{"line_number":395,"context_line":"        self.assertEqual(\u0027b\u0027, parts[1])"},{"line_number":396,"context_line":"        self.assertEqual(\u0027100\u0027, parts[2])"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @mock.patch.object(vm_store.Store, \u0027select_datastore\u0027)"},{"line_number":399,"context_line":"    @mock.patch.object(api, \u0027VMwareAPISession\u0027)"},{"line_number":400,"context_line":"    def test_unexpected_status(self, mock_api_session, mock_select_datastore):"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba7be1f8_516c3b08","line":397,"updated":"2015-03-04 04:16:42.000000000","message":"would you mind to add a case for default weight logic? I mean \"datastore \u003d \u0027a:b:c\u0027\" means weight is 0.","commit_id":"f91f23b2c5c57c4909ede22f5c66b4717270e8f0"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"e3b3b48da83578844552996160293f69581c7b7b","unresolved":false,"context_lines":[{"line_number":394,"context_line":"        self.assertEqual(\u0027a\u0027, parts[0])"},{"line_number":395,"context_line":"        self.assertEqual(\u0027b\u0027, parts[1])"},{"line_number":396,"context_line":"        self.assertEqual(\u0027100\u0027, parts[2])"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    @mock.patch.object(vm_store.Store, \u0027select_datastore\u0027)"},{"line_number":399,"context_line":"    @mock.patch.object(api, \u0027VMwareAPISession\u0027)"},{"line_number":400,"context_line":"    def test_unexpected_status(self, mock_api_session, mock_select_datastore):"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a80dd14_c7bd9e04","line":397,"in_reply_to":"ba7be1f8_516c3b08","updated":"2015-03-04 07:56:43.000000000","message":"Good point. Added !","commit_id":"f91f23b2c5c57c4909ede22f5c66b4717270e8f0"}]}
