)]}'
{"nova/tests/virt/vmwareapi/test_vmwareapi_vm_util_datastore_selection.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"971e71e3f432814010adfec72e60911325a2064a","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def test_filter_datastores_best_match(self):"},{"line_number":122,"context_line":"        data \u003d ["},{"line_number":123,"context_line":"            [\u0027VMFS\u0027, \u0027spam-good\u0027, True, 20*1024*1024, 10*1024*1024],"},{"line_number":124,"context_line":"            [\u0027NFS\u0027, \u0027eggs-good\u0027, True, 40*1024*1024, 15*1024*1024],"},{"line_number":125,"context_line":"            [\u0027BAD\u0027, \u0027some-name-bad\u0027, True, 30*1024*1024, 20*1024*1024],"},{"line_number":126,"context_line":"            [\u0027VMFS\u0027, \u0027some-name-good\u0027, True, 50*1024*1024, 5*1024*1024],"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvJo%3D","line":123,"updated":"2013-10-29 17:57:34.000000000","message":"please use the units from https://github.com/openstack/nova/blob/master/nova/unit.py","commit_id":"5bb9020ea5b0de8e424feb80cbab2d2f45f6bf86"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b7c4de64163683ca455a9bfc424886144ba3aaf0","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova import test"},{"line_number":20,"context_line":"from nova import unit"},{"line_number":21,"context_line":"from nova.virt.vmwareapi import vm_util"},{"line_number":22,"context_line":"from nova.virt.vmwareapi.vm_util import DSRecord"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"ResultSet \u003d collections.namedtuple(\u0027ResultSet\u0027, [\u0027objects\u0027])"},{"line_number":25,"context_line":"ResultSetToken \u003d collections.namedtuple(\u0027ResultSet\u0027, [\u0027objects\u0027, \u0027token\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F%2B5s%3D","line":22,"updated":"2014-01-05 08:07:09.000000000","message":"this causes an issue with the pep8 checks. why not just use vm_util.DSRecord?","commit_id":"db41427d550a7687057b9cae7a6f8c3d2e6029cf"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"04b6b85f4c6f18f3b1c62129fe22b8a9242b7f56","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from nova import test"},{"line_number":20,"context_line":"from nova import unit"},{"line_number":21,"context_line":"from nova.virt.vmwareapi import vm_util"},{"line_number":22,"context_line":"from nova.virt.vmwareapi.vm_util import DSRecord"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"ResultSet \u003d collections.namedtuple(\u0027ResultSet\u0027, [\u0027objects\u0027])"},{"line_number":25,"context_line":"ResultSetToken \u003d collections.namedtuple(\u0027ResultSet\u0027, [\u0027objects\u0027, \u0027token\u0027])"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2F9RI%3D","line":22,"in_reply_to":"AAAAUH%2F%2F%2B5s%3D","updated":"2014-01-06 08:16:07.000000000","message":"Done","commit_id":"db41427d550a7687057b9cae7a6f8c3d2e6029cf"}],"nova/virt/vmwareapi/fake.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"f78bfc4934bfc5518663e073a8e802e893c6b3fe","unresolved":false,"context_lines":[{"line_number":492,"context_line":"    \"\"\"Datastore class.\"\"\""},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"    def __init__(self, name\u003d\"fake-ds\","},{"line_number":495,"context_line":"                 capacity\u003dunit.Ti,"},{"line_number":496,"context_line":"                 free_space\u003d500 * unit.Gi):"},{"line_number":497,"context_line":"        super(Datastore, self).__init__(\"ds\")"},{"line_number":498,"context_line":"        self.set(\"summary.type\", \"VMFS\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F%2FrpA%3D","line":495,"updated":"2013-10-30 14:00:58.000000000","message":"this should be:\ncapacity\u003d1024 * unit.Gi","commit_id":"aa6a91dc42f3616bd2c139cfa9056168361be01b"}],"nova/virt/vmwareapi/vm_util.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"971e71e3f432814010adfec72e60911325a2064a","unresolved":false,"context_lines":[{"line_number":899,"context_line":"                    best_match \u003d new_ds"},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"    return tuple(best_match)"},{"line_number":902,"context_line":""},{"line_number":903,"context_line":"def get_datastore_ref_and_name(session, cluster\u003dNone, host\u003dNone,"},{"line_number":904,"context_line":"                               datastore_regex\u003dNone):"},{"line_number":905,"context_line":"    \"\"\"Get the datastore list and choose the most preferable one.\"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvJ8%3D","line":902,"updated":"2013-10-29 17:57:34.000000000","message":"need a extra new line here (pep8)","commit_id":"5bb9020ea5b0de8e424feb80cbab2d2f45f6bf86"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"971e71e3f432814010adfec72e60911325a2064a","unresolved":false,"context_lines":[{"line_number":931,"context_line":"                                 \"summary.accessible\"])"},{"line_number":932,"context_line":"    best_match \u003d (None, None, None, 0)"},{"line_number":933,"context_line":"    while data_stores:"},{"line_number":934,"context_line":"        best_match \u003d _select_datastore(data_stores, best_match, datastore_regex)"},{"line_number":935,"context_line":"        token \u003d _get_token(data_stores)"},{"line_number":936,"context_line":"        if not token:"},{"line_number":937,"context_line":"            break"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvJ0%3D","line":934,"updated":"2013-10-29 17:57:34.000000000","message":"line is too long here","commit_id":"5bb9020ea5b0de8e424feb80cbab2d2f45f6bf86"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"971e71e3f432814010adfec72e60911325a2064a","unresolved":false,"context_lines":[{"line_number":942,"context_line":"        return best_match"},{"line_number":943,"context_line":"    if datastore_regex:"},{"line_number":944,"context_line":"        raise exception.DatastoreNotFound("},{"line_number":945,"context_line":"        _(\"Datastore regex %s did not match any datastores\")"},{"line_number":946,"context_line":"        % datastore_regex.pattern)"},{"line_number":947,"context_line":"    else:"},{"line_number":948,"context_line":"        raise exception.DatastoreNotFound()"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvKI%3D","line":945,"updated":"2013-10-29 17:57:34.000000000","message":"indentation here is odd - can you please address this","commit_id":"5bb9020ea5b0de8e424feb80cbab2d2f45f6bf86"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"971e71e3f432814010adfec72e60911325a2064a","unresolved":false,"context_lines":[{"line_number":946,"context_line":"        % datastore_regex.pattern)"},{"line_number":947,"context_line":"    else:"},{"line_number":948,"context_line":"        raise exception.DatastoreNotFound()"},{"line_number":949,"context_line":""},{"line_number":950,"context_line":"def get_vmdk_backed_disk_uuid(hardware_devices, volume_uuid):"},{"line_number":951,"context_line":"    if hardware_devices.__class__.__name__ \u003d\u003d \"ArrayOfVirtualDevice\":"},{"line_number":952,"context_line":"        hardware_devices \u003d hardware_devices.VirtualDevice"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAATn%2F%2FvJs%3D","line":949,"updated":"2013-10-29 17:57:34.000000000","message":"missing new line","commit_id":"5bb9020ea5b0de8e424feb80cbab2d2f45f6bf86"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"441602d1fdf872296a479d35f4a6fea4317e920d","unresolved":false,"context_lines":[{"line_number":867,"context_line":"    :param datastore_regex: an optional regular expression to match names"},{"line_number":868,"context_line":"    :return: datastore_ref, datastore_name, capacity, freespace"},{"line_number":869,"context_line":"    \"\"\""},{"line_number":870,"context_line":"    DSRecord \u003d collections.namedtuple("},{"line_number":871,"context_line":"        \u0027DSRecord\u0027, [\u0027datastore\u0027, \u0027name\u0027, \u0027capacity\u0027, \u0027freespace\u0027])"},{"line_number":872,"context_line":""},{"line_number":873,"context_line":"    #TODO(hartsocks): refactor driver to use DSRecord namedtuple"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FsNs%3D","line":870,"updated":"2013-10-30 11:47:23.000000000","message":"Consider defining this globally and then using it as the parameter for the best_match.","commit_id":"43363f42f7de321a440b80c164fc8083bb427199"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"441602d1fdf872296a479d35f4a6fea4317e920d","unresolved":false,"context_lines":[{"line_number":898,"context_line":"                if new_ds.freespace \u003e best_match.freespace:"},{"line_number":899,"context_line":"                    best_match \u003d new_ds"},{"line_number":900,"context_line":""},{"line_number":901,"context_line":"    return tuple(best_match)"},{"line_number":902,"context_line":""},{"line_number":903,"context_line":""},{"line_number":904,"context_line":"def get_datastore_ref_and_name(session, cluster\u003dNone, host\u003dNone,"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FsNk%3D","line":901,"updated":"2013-10-30 11:47:23.000000000","message":"Then you can return best_match","commit_id":"43363f42f7de321a440b80c164fc8083bb427199"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"441602d1fdf872296a479d35f4a6fea4317e920d","unresolved":false,"context_lines":[{"line_number":930,"context_line":"                                [\"summary.type\", \"summary.name\","},{"line_number":931,"context_line":"                                 \"summary.capacity\", \"summary.freeSpace\","},{"line_number":932,"context_line":"                                 \"summary.accessible\"])"},{"line_number":933,"context_line":"    best_match \u003d (None, None, None, 0)"},{"line_number":934,"context_line":"    while data_stores:"},{"line_number":935,"context_line":"        best_match \u003d _select_datastore(data_stores, best_match,"},{"line_number":936,"context_line":"                                       datastore_regex)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FsNg%3D","line":933,"updated":"2013-10-30 11:47:23.000000000","message":"best_match \u003d DSRecord(datastore\u003dNone, name\u003dNone, capacity\u003dNone, freespace\u003d0)","commit_id":"43363f42f7de321a440b80c164fc8083bb427199"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"441602d1fdf872296a479d35f4a6fea4317e920d","unresolved":false,"context_lines":[{"line_number":940,"context_line":"        data_stores \u003d session._call_method(vim_util,"},{"line_number":941,"context_line":"                                           \"continue_to_get_objects\","},{"line_number":942,"context_line":"                                           token)"},{"line_number":943,"context_line":"    if best_match[0]:"},{"line_number":944,"context_line":"        return best_match"},{"line_number":945,"context_line":"    if datastore_regex:"},{"line_number":946,"context_line":"        raise exception.DatastoreNotFound("}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F%2FsMs%3D","line":943,"updated":"2013-10-30 11:47:23.000000000","message":"if best_match.datastore:\n    return (best_match.ds.datastore, best_match.ds.name, ...","commit_id":"43363f42f7de321a440b80c164fc8083bb427199"},{"author":{"_account_id":7629,"name":"Shawn Hartsock","email":"hartsock@acm.org","username":"hartsocks"},"change_message_id":"5e01863b9e626e448a5191d3652980bde255b4da","unresolved":false,"context_lines":[{"line_number":36,"context_line":"# together and improve readability and organisation of the code."},{"line_number":37,"context_line":"DSRecord \u003d collections.namedtuple("},{"line_number":38,"context_line":"    \u0027DSRecord\u0027, [\u0027datastore\u0027, \u0027name\u0027, \u0027capacity\u0027, \u0027freespace\u0027])"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"def build_datastore_path(datastore_name, path):"},{"line_number":42,"context_line":"    \"\"\"Build the datastore compliant path.\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAAUH%2F%2F2ek%3D","line":39,"updated":"2014-01-07 17:22:51.000000000","message":"NOTE: I\u0027m beginning to think we may need to go for a full object here at some point. This is fine for now.","commit_id":"1a4d4688669cc19ae0a29dae7385d912aeaf17aa"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"58f82c81de6daf8936ca28be7214550ef14cbd3c","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"#TODO(hartsocks): refactor driver to use DSRecord namedtuple"},{"line_number":33,"context_line":"# using DSRecord through out will help keep related information"},{"line_number":34,"context_line":"# together and improve readability and organisation of the code."},{"line_number":35,"context_line":"DSRecord \u003d collections.namedtuple("},{"line_number":36,"context_line":"    \u0027DSRecord\u0027, [\u0027datastore\u0027, \u0027name\u0027, \u0027capacity\u0027, \u0027freespace\u0027])"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fz0s%3D","line":34,"updated":"2014-02-24 17:50:45.000000000","message":"This is not really something we need to mention in the code. Better remove it and stick it in the commit message.","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"322118468d122777a5ce142a377bdc57d3006fbc","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"#TODO(hartsocks): refactor driver to use DSRecord namedtuple"},{"line_number":33,"context_line":"# using DSRecord through out will help keep related information"},{"line_number":34,"context_line":"# together and improve readability and organisation of the code."},{"line_number":35,"context_line":"DSRecord \u003d collections.namedtuple("},{"line_number":36,"context_line":"    \u0027DSRecord\u0027, [\u0027datastore\u0027, \u0027name\u0027, \u0027capacity\u0027, \u0027freespace\u0027])"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fsik%3D","line":34,"in_reply_to":"AAAAU3%2F%2Fz0s%3D","updated":"2014-02-25 08:16:16.000000000","message":"Done","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"58f82c81de6daf8936ca28be7214550ef14cbd3c","unresolved":false,"context_lines":[{"line_number":873,"context_line":"    return dict([(prop.name, prop.val) for prop in propset])"},{"line_number":874,"context_line":""},{"line_number":875,"context_line":""},{"line_number":876,"context_line":"def _select_datastore(data_stores, best_match, datastore_regex\u003dNone):"},{"line_number":877,"context_line":"    \"\"\"Find the most preferable datastore in a given RetrieveResult object."},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    :param data_stores: a RetrieveResult object from vSphere API call"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2FznE%3D","line":876,"updated":"2014-02-24 17:50:45.000000000","message":"We don\u0027t really need to pass it in as a param just because we pulled the namedtuple definition out, do we? Is there a use case where we want to pass something other than just a 0 freespace, datastore\u003dNone dummy value?\n\nIs there a use case for this that I am missing?","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"322118468d122777a5ce142a377bdc57d3006fbc","unresolved":false,"context_lines":[{"line_number":873,"context_line":"    return dict([(prop.name, prop.val) for prop in propset])"},{"line_number":874,"context_line":""},{"line_number":875,"context_line":""},{"line_number":876,"context_line":"def _select_datastore(data_stores, best_match, datastore_regex\u003dNone):"},{"line_number":877,"context_line":"    \"\"\"Find the most preferable datastore in a given RetrieveResult object."},{"line_number":878,"context_line":""},{"line_number":879,"context_line":"    :param data_stores: a RetrieveResult object from vSphere API call"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fse8%3D","line":876,"in_reply_to":"AAAAU3%2F%2FznE%3D","updated":"2014-02-25 08:16:16.000000000","message":"The use case is when the backend returns a token and we need to do another iteration to find the best datastore, see the loop on line 942.  We pass the current best_match and try to find a better one on each iteration. The best_match is updated on every iteration, see line 943.","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"58f82c81de6daf8936ca28be7214550ef14cbd3c","unresolved":false,"context_lines":[{"line_number":949,"context_line":"                                           \"continue_to_get_objects\","},{"line_number":950,"context_line":"                                           token)"},{"line_number":951,"context_line":"    if best_match.datastore:"},{"line_number":952,"context_line":"        return tuple(best_match)"},{"line_number":953,"context_line":"    if datastore_regex:"},{"line_number":954,"context_line":"        raise exception.DatastoreNotFound("},{"line_number":955,"context_line":"            _(\"Datastore regex %s did not match any datastores\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fzro%3D","line":952,"updated":"2014-02-24 17:50:45.000000000","message":"I don\u0027t think we need to cast it back to tuple - named tuple is just as tuple as any other tuple :)","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"322118468d122777a5ce142a377bdc57d3006fbc","unresolved":false,"context_lines":[{"line_number":949,"context_line":"                                           \"continue_to_get_objects\","},{"line_number":950,"context_line":"                                           token)"},{"line_number":951,"context_line":"    if best_match.datastore:"},{"line_number":952,"context_line":"        return tuple(best_match)"},{"line_number":953,"context_line":"    if datastore_regex:"},{"line_number":954,"context_line":"        raise exception.DatastoreNotFound("},{"line_number":955,"context_line":"            _(\"Datastore regex %s did not match any datastores\")"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAU3%2F%2Fsew%3D","line":952,"in_reply_to":"AAAAU3%2F%2Fzro%3D","updated":"2014-02-25 08:16:16.000000000","message":"Thanks! Done.","commit_id":"38daa4ef23930d7dcf7acce0960e558240e918d1"}]}
