)]}'
{"nova/virt/vmwareapi/vim_util.py":[{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"37d4eb7bffd425edd2581ae3aa2cee21083c1311","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            specSet\u003d[property_filter_spec], options\u003doptions)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":""},{"line_number":221,"context_line":"def get_inner_objects(vim, base_obj, path, inner_type,"},{"line_number":222,"context_line":"                      properties_to_collect\u003dNone, all\u003dFalse):"},{"line_number":223,"context_line":"    \"\"\"Gets the list of inner objects of the type specified.\"\"\""},{"line_number":224,"context_line":"    client_factory \u003d vim.client.factory"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8pH8%3D","line":221,"updated":"2013-12-23 21:31:18.000000000","message":"I can\u0027t find testing for this. You should be able to test just the logic in this block using some @mock.patch decorators on the test to over-ride vm.client.factory and a few choice names in this namespace.","commit_id":"9dd2cb0baf27268f87ec3c30b3fda5685817fda0"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"26127930f5f2b3dfdc01e0ac3a45bf79f83ccddd","unresolved":false,"context_lines":[{"line_number":237,"context_line":"            vim.get_service_content().propertyCollector,"},{"line_number":238,"context_line":"            specSet\u003d[property_filter_spec], options\u003doptions)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"def cancel_retrieve(vim, token):"},{"line_number":242,"context_line":"    \"\"\"Cancels the retrieve operation.\"\"\""},{"line_number":243,"context_line":"    return vim.CancelRetrievePropertiesEx("}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAT3%2F%2FyEc%3D","line":240,"updated":"2013-12-31 21:21:11.000000000","message":"This method would be rather difficult to test. You should be able to do it using a complex mock at vim.client.factory and another complex mock at vim.RetrievePropertiesEx\n\nI\u0027ll see about posting some example code for another method that you can use as an example.","commit_id":"e820f2e725b8c86a78e770547b16935872984093"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"f942b112582689ab9d1417bf1b2d040c342a9783","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"def get_inner_objects(vim, base_obj, path, inner_type,"},{"line_number":220,"context_line":"                      properties_to_collect\u003dNone, all\u003dFalse):"},{"line_number":221,"context_line":"    \"\"\"Gets the list of inner objects of the type specified.\"\"\""},{"line_number":222,"context_line":"    client_factory \u003d vim.client.factory"},{"line_number":223,"context_line":"    base_type \u003d base_obj._type"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2FzQs%3D","line":220,"updated":"2014-02-24 18:14:23.000000000","message":"Is there any reason why we are not testing these - I see that very few things from this module are not tested, and this one seems like a great candidate for testing.","commit_id":"256bea8bcf169badb7548b8f9925e9f4e7dce385"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"44b1eeee3fd0404dbd1fead041b0596282211c08","unresolved":false,"context_lines":[{"line_number":217,"context_line":""},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"def get_inner_objects(vim, base_obj, path, inner_type,"},{"line_number":220,"context_line":"                      properties_to_collect\u003dNone, all\u003dFalse):"},{"line_number":221,"context_line":"    \"\"\"Gets the list of inner objects of the type specified.\"\"\""},{"line_number":222,"context_line":"    client_factory \u003d vim.client.factory"},{"line_number":223,"context_line":"    base_type \u003d base_obj._type"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fvtk%3D","line":220,"in_reply_to":"AAAAU3%2F%2FzQs%3D","updated":"2014-02-25 00:38:27.000000000","message":"This gets tested by test_get_available_resource in test_driver_api.py. The code path invokes this method which works upon the fixtures. But I agree that it can be explicitly tested too. I have added a test case in test_vim_util.py. Please take a look.","commit_id":"256bea8bcf169badb7548b8f9925e9f4e7dce385"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"0ae5741fcb29e300d2630a4bf3884ca939f07104","unresolved":false,"context_lines":[{"line_number":28,"context_line":"from nova.openstack.common import log as logging"},{"line_number":29,"context_line":"from nova.virt.vmwareapi import vim_util"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"import operator"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":34,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATH%2F%2FRHQ%3D","line":31,"updated":"2013-10-18 18:08:39.000000000","message":"this import is not in the correct place","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ebff9440d60eb6278d7c2f901e7be9b961295313","unresolved":false,"context_lines":[{"line_number":863,"context_line":""},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"def _is_valid_ds_record(ds, datastore_regex\u003dNone):"},{"line_number":866,"context_line":"    \"\"\"Check if a give datastore record is valid.\"\"\""},{"line_number":867,"context_line":"    # Local storage identifier vSphere doesn\u0027t support CIFS or"},{"line_number":868,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":869,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fswc%3D","line":866,"updated":"2013-10-30 09:31:56.000000000","message":"typo: given","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"a76787368372db6db12be5d17555c750dbdffd0b","unresolved":false,"context_lines":[{"line_number":863,"context_line":""},{"line_number":864,"context_line":""},{"line_number":865,"context_line":"def _is_valid_ds_record(ds, datastore_regex\u003dNone):"},{"line_number":866,"context_line":"    \"\"\"Check if a give datastore record is valid.\"\"\""},{"line_number":867,"context_line":"    # Local storage identifier vSphere doesn\u0027t support CIFS or"},{"line_number":868,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":869,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FrEM%3D","line":866,"in_reply_to":"AAAATn%2F%2Fswc%3D","updated":"2013-10-30 15:52:17.000000000","message":"Will do. Thanks","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ebff9440d60eb6278d7c2f901e7be9b961295313","unresolved":false,"context_lines":[{"line_number":901,"context_line":"                        freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":902,"context_line":"                        accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":903,"context_line":"            if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":904,"context_line":"                ds_records.append(new_ds)"},{"line_number":905,"context_line":"        token \u003d _get_token(data_stores)"},{"line_number":906,"context_line":"        if token:"},{"line_number":907,"context_line":"            data_stores \u003d session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fsuw%3D","line":904,"updated":"2013-10-30 09:31:56.000000000","message":"do we want to keep all objects in memory or rather iterate them and collect/select what we need?","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"a76c01958bb3cd6f054d82d1519dda09dc3ff823","unresolved":false,"context_lines":[{"line_number":901,"context_line":"                        freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":902,"context_line":"                        accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":903,"context_line":"            if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":904,"context_line":"                ds_records.append(new_ds)"},{"line_number":905,"context_line":"        token \u003d _get_token(data_stores)"},{"line_number":906,"context_line":"        if token:"},{"line_number":907,"context_line":"            data_stores \u003d session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fq1Y%3D","line":904,"in_reply_to":"AAAATn%2F%2Fq6I%3D","updated":"2013-10-30 16:24:38.000000000","message":"I think what we need is a way to iterate over the results and then we can easily implement reduce/filter functionality which is decoupled from the retrieving part.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"ef1395f7b850c8827148f1cd2d895fd2a33781bd","unresolved":false,"context_lines":[{"line_number":901,"context_line":"                        freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":902,"context_line":"                        accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":903,"context_line":"            if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":904,"context_line":"                ds_records.append(new_ds)"},{"line_number":905,"context_line":"        token \u003d _get_token(data_stores)"},{"line_number":906,"context_line":"        if token:"},{"line_number":907,"context_line":"            data_stores \u003d session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fq6I%3D","line":904,"in_reply_to":"AAAATn%2F%2FrBk%3D","updated":"2013-10-30 16:07:57.000000000","message":"typo in want :). Anyways, we can probably make this a bit efficient by passing the filters to this method.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"a76787368372db6db12be5d17555c750dbdffd0b","unresolved":false,"context_lines":[{"line_number":901,"context_line":"                        freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":902,"context_line":"                        accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":903,"context_line":"            if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":904,"context_line":"                ds_records.append(new_ds)"},{"line_number":905,"context_line":"        token \u003d _get_token(data_stores)"},{"line_number":906,"context_line":"        if token:"},{"line_number":907,"context_line":"            data_stores \u003d session._call_method(vim_util,"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FrBk%3D","line":904,"in_reply_to":"AAAATn%2F%2Fsuw%3D","updated":"2013-10-30 15:52:17.000000000","message":"We wan\u0027t to separate the logic of fetching datastores and working upon them. So that methods like get_stats  can collect aggregate usage stats and methods like get_datastore_ref_and_name can choose a ds with largest capacity (or apply more policies). I am open to ideas, we can also discuss in IRC today.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ebff9440d60eb6278d7c2f901e7be9b961295313","unresolved":false,"context_lines":[{"line_number":914,"context_line":""},{"line_number":915,"context_line":"def get_datastore_ref_and_name(session, cluster\u003dNone, host\u003dNone,"},{"line_number":916,"context_line":"                               datastore_regex\u003dNone):"},{"line_number":917,"context_line":"    \"\"\"Get the datastore list and choose the first local storage.\"\"\""},{"line_number":918,"context_line":"    ds_records \u003d _get_valid_datastore_records(session, cluster, host,"},{"line_number":919,"context_line":"                                              datastore_regex)"},{"line_number":920,"context_line":"    if ds_records:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fsx0%3D","line":917,"updated":"2013-10-30 09:31:56.000000000","message":"this pydoc is wrong","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"a76787368372db6db12be5d17555c750dbdffd0b","unresolved":false,"context_lines":[{"line_number":914,"context_line":""},{"line_number":915,"context_line":"def get_datastore_ref_and_name(session, cluster\u003dNone, host\u003dNone,"},{"line_number":916,"context_line":"                               datastore_regex\u003dNone):"},{"line_number":917,"context_line":"    \"\"\"Get the datastore list and choose the first local storage.\"\"\""},{"line_number":918,"context_line":"    ds_records \u003d _get_valid_datastore_records(session, cluster, host,"},{"line_number":919,"context_line":"                                              datastore_regex)"},{"line_number":920,"context_line":"    if ds_records:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FrFE%3D","line":917,"in_reply_to":"AAAATn%2F%2Fsx0%3D","updated":"2013-10-30 15:52:17.000000000","message":"Will fix this.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"ebff9440d60eb6278d7c2f901e7be9b961295313","unresolved":false,"context_lines":[{"line_number":920,"context_line":"    if ds_records:"},{"line_number":921,"context_line":"        # Get datastore with maximum freespace"},{"line_number":922,"context_line":"        ds \u003d max(ds_records, key\u003doperator.attrgetter(\u0027freespace\u0027))"},{"line_number":923,"context_line":"        return ds.datastore, ds.name, ds.capacity, ds.freespace"},{"line_number":924,"context_line":"    # No Datastores found matching our criteria"},{"line_number":925,"context_line":"    if datastore_regex:"},{"line_number":926,"context_line":"        raise exception.DatastoreNotFound("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fswg%3D","line":923,"updated":"2013-10-30 09:31:56.000000000","message":"return tuple(ds)","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"a76c01958bb3cd6f054d82d1519dda09dc3ff823","unresolved":false,"context_lines":[{"line_number":920,"context_line":"    if ds_records:"},{"line_number":921,"context_line":"        # Get datastore with maximum freespace"},{"line_number":922,"context_line":"        ds \u003d max(ds_records, key\u003doperator.attrgetter(\u0027freespace\u0027))"},{"line_number":923,"context_line":"        return ds.datastore, ds.name, ds.capacity, ds.freespace"},{"line_number":924,"context_line":"    # No Datastores found matching our criteria"},{"line_number":925,"context_line":"    if datastore_regex:"},{"line_number":926,"context_line":"        raise exception.DatastoreNotFound("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2Fq5U%3D","line":923,"in_reply_to":"AAAATn%2F%2FrEg%3D","updated":"2013-10-30 16:24:38.000000000","message":"OK, now I see that you have changed DSRecord to contain more properties. You can ignore this comment.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"a76787368372db6db12be5d17555c750dbdffd0b","unresolved":false,"context_lines":[{"line_number":920,"context_line":"    if ds_records:"},{"line_number":921,"context_line":"        # Get datastore with maximum freespace"},{"line_number":922,"context_line":"        ds \u003d max(ds_records, key\u003doperator.attrgetter(\u0027freespace\u0027))"},{"line_number":923,"context_line":"        return ds.datastore, ds.name, ds.capacity, ds.freespace"},{"line_number":924,"context_line":"    # No Datastores found matching our criteria"},{"line_number":925,"context_line":"    if datastore_regex:"},{"line_number":926,"context_line":"        raise exception.DatastoreNotFound("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAATn%2F%2FrEg%3D","line":923,"in_reply_to":"AAAATn%2F%2Fswg%3D","updated":"2013-10-30 15:52:17.000000000","message":"All callers of this method expect only the specified values and not all values in the ds record. I cannot return the entire ds record, if that\u0027s what you meant. Please let me know.","commit_id":"abbefdc886adde8db6826b4b385457f1292d93ee"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c85a74dd6f6836128fe15ee37a07554fd2bdf73a","unresolved":false,"context_lines":[{"line_number":795,"context_line":"            result \u003d session._call_method(vim_util,"},{"line_number":796,"context_line":"                         \"get_properties_for_a_collection_of_objects\","},{"line_number":797,"context_line":"                         \"HostSystem\", host_mors, [\"summary.hardware\"])"},{"line_number":798,"context_line":"            for obj in result.objects:"},{"line_number":799,"context_line":"                hardware_summary \u003d obj.propSet[0].val"},{"line_number":800,"context_line":"                # Total vcpus is the sum of all pCPUs of individual hosts"},{"line_number":801,"context_line":"                # The overcommitment ratio is factored in by the scheduler"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BSbM%3D","line":798,"updated":"2013-11-27 20:34:47.000000000","message":"please add: if hasattr(obj, \u0027propSet\u0027):","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"dbb60a597ae03c748eb87dbbb087b84b55bd4fb6","unresolved":false,"context_lines":[{"line_number":795,"context_line":"            result \u003d session._call_method(vim_util,"},{"line_number":796,"context_line":"                         \"get_properties_for_a_collection_of_objects\","},{"line_number":797,"context_line":"                         \"HostSystem\", host_mors, [\"summary.hardware\"])"},{"line_number":798,"context_line":"            for obj in result.objects:"},{"line_number":799,"context_line":"                hardware_summary \u003d obj.propSet[0].val"},{"line_number":800,"context_line":"                # Total vcpus is the sum of all pCPUs of individual hosts"},{"line_number":801,"context_line":"                # The overcommitment ratio is factored in by the scheduler"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BCbY%3D","line":798,"in_reply_to":"AAAATn%2F%2BSbM%3D","updated":"2013-12-03 06:55:20.000000000","message":"Done","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c85a74dd6f6836128fe15ee37a07554fd2bdf73a","unresolved":false,"context_lines":[{"line_number":831,"context_line":"                    capacity\u003dpropdict[\u0027summary.capacity\u0027],"},{"line_number":832,"context_line":"                    freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":833,"context_line":"                    accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":834,"context_line":"                if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":835,"context_line":"                    ds_info[\u0027total\u0027] +\u003d new_ds.capacity / unit.Gi"},{"line_number":836,"context_line":"                    ds_info[\u0027free\u0027] +\u003d new_ds.freespace / unit.Gi"},{"line_number":837,"context_line":"        token \u003d _get_token(data_stores)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BSZs%3D","line":834,"updated":"2013-11-27 20:34:47.000000000","message":"it would have made the review a whole lot easier if _is_valid_ds_record was defied above :)","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"dbb60a597ae03c748eb87dbbb087b84b55bd4fb6","unresolved":false,"context_lines":[{"line_number":831,"context_line":"                    capacity\u003dpropdict[\u0027summary.capacity\u0027],"},{"line_number":832,"context_line":"                    freespace\u003dpropdict[\u0027summary.freeSpace\u0027],"},{"line_number":833,"context_line":"                    accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":834,"context_line":"                if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":835,"context_line":"                    ds_info[\u0027total\u0027] +\u003d new_ds.capacity / unit.Gi"},{"line_number":836,"context_line":"                    ds_info[\u0027free\u0027] +\u003d new_ds.freespace / unit.Gi"},{"line_number":837,"context_line":"        token \u003d _get_token(data_stores)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BCbU%3D","line":834,"in_reply_to":"AAAATn%2F%2BSZs%3D","updated":"2013-12-03 06:55:20.000000000","message":"Done","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"c85a74dd6f6836128fe15ee37a07554fd2bdf73a","unresolved":false,"context_lines":[{"line_number":989,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":990,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"},{"line_number":991,"context_line":"        if datastore_regex is None or datastore_regex.match(ds.name):"},{"line_number":992,"context_line":"                return True"},{"line_number":993,"context_line":"    return False"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BSZo%3D","line":992,"updated":"2013-11-27 20:34:47.000000000","message":"indentation","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":7575,"name":"Sabari","email":"smurugesan@vmware.com","username":"sabari"},"change_message_id":"dbb60a597ae03c748eb87dbbb087b84b55bd4fb6","unresolved":false,"context_lines":[{"line_number":989,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":990,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"},{"line_number":991,"context_line":"        if datastore_regex is None or datastore_regex.match(ds.name):"},{"line_number":992,"context_line":"                return True"},{"line_number":993,"context_line":"    return False"},{"line_number":994,"context_line":""},{"line_number":995,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2BCbQ%3D","line":992,"in_reply_to":"AAAATn%2F%2BSZo%3D","updated":"2013-12-03 06:55:20.000000000","message":"Done","commit_id":"7f16b211da77872ea38034052293ac717b54a47f"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"37d4eb7bffd425edd2581ae3aa2cee21083c1311","unresolved":false,"context_lines":[{"line_number":788,"context_line":"    \"\"\""},{"line_number":789,"context_line":"    # Local storage identifier vSphere doesn\u0027t support CIFS or"},{"line_number":790,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":791,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"},{"line_number":792,"context_line":"        if datastore_regex is None or datastore_regex.match(ds.name):"},{"line_number":793,"context_line":"            return True"},{"line_number":794,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8pJs%3D","line":791,"updated":"2013-12-23 21:31:18.000000000","message":"consider:\nif ds.accessible and ds.type in [\u0027VMFS\u0027, \u0027NFS\u0027]:\n\n\n... although there\u0027s a good argument that this is inefficient, it is shorter....","commit_id":"9dd2cb0baf27268f87ec3c30b3fda5685817fda0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"1ad9995ded7a8ae28f0972d3ecda8b6f9bf9f9fa","unresolved":false,"context_lines":[{"line_number":788,"context_line":"    \"\"\""},{"line_number":789,"context_line":"    # Local storage identifier vSphere doesn\u0027t support CIFS or"},{"line_number":790,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":791,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"},{"line_number":792,"context_line":"        if datastore_regex is None or datastore_regex.match(ds.name):"},{"line_number":793,"context_line":"            return True"},{"line_number":794,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8%2BRA%3D","line":791,"updated":"2013-12-18 08:45:36.000000000","message":"please check ds.accessible first","commit_id":"9dd2cb0baf27268f87ec3c30b3fda5685817fda0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"cbf8db75fa43dd92a63499515f942dc14888e9ad","unresolved":false,"context_lines":[{"line_number":788,"context_line":"    \"\"\""},{"line_number":789,"context_line":"    # Local storage identifier vSphere doesn\u0027t support CIFS or"},{"line_number":790,"context_line":"    # vfat for datastores, therefore filtered"},{"line_number":791,"context_line":"    if (ds.type \u003d\u003d \u0027VMFS\u0027 or ds.type \u003d\u003d \u0027NFS\u0027) and ds.accessible:"},{"line_number":792,"context_line":"        if datastore_regex is None or datastore_regex.match(ds.name):"},{"line_number":793,"context_line":"            return True"},{"line_number":794,"context_line":"    return False"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8nxs%3D","line":791,"in_reply_to":"AAAATn%2F8pJs%3D","updated":"2013-12-24 07:28:47.000000000","message":"that is the best option. first check integer/flag and if that is valid then proceed to the string matches. the \u0027in\u0027 check is far more readable and will be better when we have additional storage types.","commit_id":"9dd2cb0baf27268f87ec3c30b3fda5685817fda0"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"37d4eb7bffd425edd2581ae3aa2cee21083c1311","unresolved":false,"context_lines":[{"line_number":794,"context_line":"    return False"},{"line_number":795,"context_line":""},{"line_number":796,"context_line":""},{"line_number":797,"context_line":"def get_stats_from_cluster(session, cluster, datastore_regex\u003dNone):"},{"line_number":798,"context_line":"    \"\"\"Get the aggregate resource stats of a cluster.\"\"\""},{"line_number":799,"context_line":"    cpu_info \u003d {\u0027vcpus\u0027: 0, \u0027cores\u0027: 0, \u0027vendor\u0027: [], \u0027model\u0027: []}"},{"line_number":800,"context_line":"    mem_info \u003d {\u0027total\u0027: 0, \u0027free\u0027: 0}"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F8pGo%3D","line":797,"updated":"2013-12-23 21:31:18.000000000","message":"You should be able to provide testing for this method using some careful mocks to session._call_method\n\nLook at:\nhttp://www.voidspace.org.uk/python/mock/patch.html","commit_id":"9dd2cb0baf27268f87ec3c30b3fda5685817fda0"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"6f93d5ed8c146b32a774c6e15b42aa5e5e2a22ee","unresolved":false,"context_lines":[{"line_number":941,"context_line":"                    type\u003dds_type,"},{"line_number":942,"context_line":"                    accessible\u003dpropdict[\u0027summary.accessible\u0027])"},{"line_number":943,"context_line":"        if _is_valid_ds_record(new_ds, datastore_regex):"},{"line_number":944,"context_line":"                # favor datastores with more free space"},{"line_number":945,"context_line":"                if new_ds.freespace \u003e best_match.freespace:"},{"line_number":946,"context_line":"                    best_match \u003d new_ds"},{"line_number":947,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAAUH%2F9pDs%3D","line":944,"updated":"2014-02-05 12:23:57.000000000","message":"indentation looks problematic here. can you please check","commit_id":"e8546b1ffe96353ae050cbb3c5923f6d48a469d2"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1cf63ad317a6d1cb67bf2cb78039639f0482c27a","unresolved":false,"context_lines":[{"line_number":1024,"context_line":"    data_stores \u003d session._call_method("},{"line_number":1025,"context_line":"        vim_util, \"get_inner_objects\", cluster, \u0027datastore\u0027, \u0027Datastore\u0027,"},{"line_number":1026,"context_line":"        properties)"},{"line_number":1027,"context_line":"    while data_stores:"},{"line_number":1028,"context_line":"        for obj_content in data_stores.objects:"},{"line_number":1029,"context_line":"            if hasattr(obj_content, \u0027propSet\u0027):"},{"line_number":1030,"context_line":"                propdict \u003d propset_dict(obj_content.propSet)"}],"source_content_type":"text/x-python","patch_set":16,"id":"AAAAVn%2F%2FiEk%3D","line":1027,"updated":"2014-03-05 15:30:18.000000000","message":"We should really abstract this pattern... I\u0027ve complained about it already... won\u0027t block tha patch on this though","commit_id":"9adba6727bbec051c1437ee95367ecb97b207f35"}]}
