)]}'
{"tempest/common/fixed_network.py":[{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    :param str name: the name of the network to use"},{"line_number":30,"context_line":"    :param NetworksClientJSON compute_networks_client: The network client"},{"line_number":31,"context_line":"        object to use for making the network lists api request"},{"line_number":32,"context_line":"    :return: The full dictionary for the network in question, unless the"},{"line_number":33,"context_line":"        network for the supplied name can not be found. In which case a dict"},{"line_number":34,"context_line":"        with just the name will be returned."},{"line_number":35,"context_line":"    :rtype: dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_79523e15","line":32,"updated":"2015-04-16 18:04:41.000000000","message":"this seems kind of error prone, that means there needs to be key tests by the callers right?","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    :param str name: the name of the network to use"},{"line_number":30,"context_line":"    :param NetworksClientJSON compute_networks_client: The network client"},{"line_number":31,"context_line":"        object to use for making the network lists api request"},{"line_number":32,"context_line":"    :return: The full dictionary for the network in question, unless the"},{"line_number":33,"context_line":"        network for the supplied name can not be found. In which case a dict"},{"line_number":34,"context_line":"        with just the name will be returned."},{"line_number":35,"context_line":"    :rtype: dict"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_ef79dbfd","line":32,"in_reply_to":"5aa745d1_79523e15","updated":"2015-04-16 20:03:30.000000000","message":"So that\u0027s what all the callers are doing right now, this get\u0027s called as part of a larger method and we pass it to set_network_kwargs()  below which handles the none case fine. The catch with this method is we don\u0027t want it to just bubble up a failure if name is invalid, instead we just don\u0027t want a network to be sent with the create requests. (which is why this just returned an incomplete dict)\n\nThat being said it would probably be clearer if we just raised a common exception in the case a network is not found and all the callers had an except in place to handle that instead.","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    \"\"\""},{"line_number":37,"context_line":"    caller \u003d misc_utils.find_test_caller()"},{"line_number":38,"context_line":"    if not name:"},{"line_number":39,"context_line":"        network \u003d {\u0027name\u0027: name}"},{"line_number":40,"context_line":"    else:"},{"line_number":41,"context_line":"        try:"},{"line_number":42,"context_line":"            resp \u003d compute_networks_client.list_networks(name\u003dname)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_9e4a9082","line":39,"updated":"2015-04-16 18:04:41.000000000","message":"why not just early return here instead of an extra level of nesting.","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":36,"context_line":"    \"\"\""},{"line_number":37,"context_line":"    caller \u003d misc_utils.find_test_caller()"},{"line_number":38,"context_line":"    if not name:"},{"line_number":39,"context_line":"        network \u003d {\u0027name\u0027: name}"},{"line_number":40,"context_line":"    else:"},{"line_number":41,"context_line":"        try:"},{"line_number":42,"context_line":"            resp \u003d compute_networks_client.list_networks(name\u003dname)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_545aa984","line":39,"in_reply_to":"5aa745d1_9e4a9082","updated":"2015-04-16 20:03:30.000000000","message":"Done","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":39,"context_line":"        network \u003d {\u0027name\u0027: name}"},{"line_number":40,"context_line":"    else:"},{"line_number":41,"context_line":"        try:"},{"line_number":42,"context_line":"            resp \u003d compute_networks_client.list_networks(name\u003dname)"},{"line_number":43,"context_line":"            if isinstance(resp, list):"},{"line_number":44,"context_line":"                networks \u003d resp"},{"line_number":45,"context_line":"            elif isinstance(resp, dict):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_fe099432","line":42,"updated":"2015-04-16 18:04:41.000000000","message":"if I understand it correctly the NotFound can only happen here, so the except here seems correct.","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            if isinstance(resp, list):"},{"line_number":44,"context_line":"                networks \u003d resp"},{"line_number":45,"context_line":"            elif isinstance(resp, dict):"},{"line_number":46,"context_line":"                networks \u003d resp[\u0027networks\u0027]"},{"line_number":47,"context_line":"            else:"},{"line_number":48,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":49,"context_line":"            if len(networks) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_de581859","line":46,"updated":"2015-04-16 18:04:41.000000000","message":"why might it be 2 different things?","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            if isinstance(resp, list):"},{"line_number":44,"context_line":"                networks \u003d resp"},{"line_number":45,"context_line":"            elif isinstance(resp, dict):"},{"line_number":46,"context_line":"                networks \u003d resp[\u0027networks\u0027]"},{"line_number":47,"context_line":"            else:"},{"line_number":48,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":49,"context_line":"            if len(networks) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_cf1aa017","line":46,"in_reply_to":"5aa745d1_de581859","updated":"2015-04-16 20:03:30.000000000","message":"This is a holdover from an earlier version where either the neutron or nova networks client was valid for using it here. They differ in their response types, one returns resp[\u0027networks\u0027] (which is a list) and the other returns resp (which is a dict)\n\nThis lack of consistency is something that Ken\u0027ichi is starting to address as part of the pre tempest-lib migration cleanups.","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            else:"},{"line_number":48,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":49,"context_line":"            if len(networks) \u003e 0:"},{"line_number":50,"context_line":"                network \u003d networks[0]"},{"line_number":51,"context_line":"            else:"},{"line_number":52,"context_line":"                msg \u003d \"Network with name: %s not found\" % name"},{"line_number":53,"context_line":"                if caller:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_3e725ce6","line":50,"updated":"2015-04-16 18:04:41.000000000","message":"so this is non deterministic when duplicate network names exist?","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":47,"context_line":"            else:"},{"line_number":48,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":49,"context_line":"            if len(networks) \u003e 0:"},{"line_number":50,"context_line":"                network \u003d networks[0]"},{"line_number":51,"context_line":"            else:"},{"line_number":52,"context_line":"                msg \u003d \"Network with name: %s not found\" % name"},{"line_number":53,"context_line":"                if caller:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_b4a7ad4e","line":50,"in_reply_to":"5aa745d1_3e725ce6","updated":"2015-04-16 20:03:30.000000000","message":"So my counter-question is: can there be duplicate network names in a single tenant? I could definitely see this being an issue with admin though if there were duplicates across tenants. I\u0027ll add a sort to the response so it\u0027ll be consistent at least.\n\n(I can really understand why the original authors used ids for all the fields, doing a lookup gets complex fast)","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":"            # To be consistent with network isolation, add name is only"},{"line_number":58,"context_line":"            # label is available"},{"line_number":59,"context_line":"            name \u003d network.get(\u0027name\u0027, network.get(\u0027label\u0027))"},{"line_number":60,"context_line":"            if name:"},{"line_number":61,"context_line":"                network[\u0027name\u0027] \u003d name"},{"line_number":62,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_d955d2c6","line":59,"updated":"2015-04-16 18:04:41.000000000","message":"this seems like a really convoluted way to do\n\nnetwork[\u0027name\u0027] \u003d network.get(\u0027name\u0027) or network.get(\u0027label\u0027) or name\n\nif not network[\u0027name\u0027]:\n   LOG.warn(\"Unable to find network....\")","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":"            # To be consistent with network isolation, add name is only"},{"line_number":58,"context_line":"            # label is available"},{"line_number":59,"context_line":"            name \u003d network.get(\u0027name\u0027, network.get(\u0027label\u0027))"},{"line_number":60,"context_line":"            if name:"},{"line_number":61,"context_line":"                network[\u0027name\u0027] \u003d name"},{"line_number":62,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_8f5db7eb","line":59,"in_reply_to":"5aa745d1_d955d2c6","updated":"2015-04-16 20:03:30.000000000","message":"Done","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"b0707725250031482645c204ba040514ce03128d","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            # one, list_networks will not find it"},{"line_number":68,"context_line":"            msg \u003d (\u0027Unable to find network %s. \u0027"},{"line_number":69,"context_line":"                   \u0027Starting instance without specifying a network.\u0027 %"},{"line_number":70,"context_line":"                   name)"},{"line_number":71,"context_line":"            if caller:"},{"line_number":72,"context_line":"                msg \u003d \u0027(%s) %s\u0027 % (caller, msg)"},{"line_number":73,"context_line":"            LOG.info(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_b969e68d","line":70,"updated":"2015-04-16 18:04:41.000000000","message":"so, name has a really good chance of being false at this point, which seems like this is going to be confusing.","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"d1103cfd8a60f3d8216e68a911304505466e5e90","unresolved":false,"context_lines":[{"line_number":67,"context_line":"            # one, list_networks will not find it"},{"line_number":68,"context_line":"            msg \u003d (\u0027Unable to find network %s. \u0027"},{"line_number":69,"context_line":"                   \u0027Starting instance without specifying a network.\u0027 %"},{"line_number":70,"context_line":"                   name)"},{"line_number":71,"context_line":"            if caller:"},{"line_number":72,"context_line":"                msg \u003d \u0027(%s) %s\u0027 % (caller, msg)"},{"line_number":73,"context_line":"            LOG.info(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5aa745d1_0f7f67ab","line":70,"in_reply_to":"5aa745d1_b969e68d","updated":"2015-04-16 20:03:30.000000000","message":"Actually it\u0027ll either be None or raise an exception because it doesn\u0027t exist. (Although I\u0027ve never seen the later behavior, but I guess I\u0027ve never tested providing a network name which didn\u0027t exist)","commit_id":"3a693aa13cfb2fe8edb1daf06d738e6c6b341926"},{"author":{"_account_id":1192,"name":"David Kranz","email":"dkranz@redhat.com","username":"david-kranz"},"change_message_id":"2008484f72317e4e679e2ddb7f084d687f4c82e1","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def get_network_from_name(name, compute_networks_client):"},{"line_number":27,"context_line":"    \"\"\"Get a full network dict from just a network name"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    :param str name: the name of the network to use"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_2b02dc6f","side":"PARENT","line":26,"updated":"2015-04-24 18:11:07.000000000","message":"The commit message says there is no functional change but the network param created and used for the \"invalid config\" is {} where it used to be {\u0027name\u0027: name}. I\u0027m not sure if that is ok or not in all cases.","commit_id":"fd683e81cc776d295548f03a2603aa5fc39758d6"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"27cbfd4f99e952d28825499f68b82c84447f0a80","unresolved":false,"context_lines":[{"line_number":23,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"def get_network_from_name(name, compute_networks_client):"},{"line_number":27,"context_line":"    \"\"\"Get a full network dict from just a network name"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"    :param str name: the name of the network to use"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_3f10d200","side":"PARENT","line":26,"in_reply_to":"bab921fb_2b02dc6f","updated":"2015-04-24 20:23:21.000000000","message":"Sorry the commit message was from an older rev before I made more thorough changes to this method. So I updated all 2 of the callers of this function to use the new model. I think before having the conditional return value was kinda weird and required too much logic in using the response further down, which made using this error prone.","commit_id":"fd683e81cc776d295548f03a2603aa5fc39758d6"},{"author":{"_account_id":1192,"name":"David Kranz","email":"dkranz@redhat.com","username":"david-kranz"},"change_message_id":"2008484f72317e4e679e2ddb7f084d687f4c82e1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # Check that a network exists, else raise an InvalidConfigurationException"},{"line_number":59,"context_line":"    if len(networks) \u003d\u003d 1:"},{"line_number":60,"context_line":"        network \u003d sorted(networks)[0]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        msg \u003d \"Network with name: %s not found\" % name"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_4b83d004","line":59,"updated":"2015-04-24 18:11:07.000000000","message":"This used to check for \u003e\u003d 1. What if there is more than one network with the same name? At minimum the error needs to not say \"not found\" if there is more than one.","commit_id":"42860da4fe239489afaa7edf81c1430513f5392a"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"6774cf33338c193d06d0d16fc24ec95bd0938997","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # Check that a network exists, else raise an InvalidConfigurationException"},{"line_number":59,"context_line":"    if len(networks) \u003d\u003d 1:"},{"line_number":60,"context_line":"        network \u003d sorted(networks)[0]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        msg \u003d \"Network with name: %s not found\" % name"}],"source_content_type":"text/x-python","patch_set":6,"id":"7ad32947_274a7584","line":59,"in_reply_to":"7ad32947_518d337a","updated":"2015-04-27 18:43:05.000000000","message":"Done","commit_id":"42860da4fe239489afaa7edf81c1430513f5392a"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"27cbfd4f99e952d28825499f68b82c84447f0a80","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # Check that a network exists, else raise an InvalidConfigurationException"},{"line_number":59,"context_line":"    if len(networks) \u003d\u003d 1:"},{"line_number":60,"context_line":"        network \u003d sorted(networks)[0]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        msg \u003d \"Network with name: %s not found\" % name"}],"source_content_type":"text/x-python","patch_set":6,"id":"bab921fb_5fd70623","line":59,"in_reply_to":"bab921fb_4b83d004","updated":"2015-04-24 20:23:21.000000000","message":"So I\u0027m pretty sure that was just an oversight previously. We\u0027re doing a list with a name filter here. So if there are duplicates returned then that\u0027s a more serious problem I think.  Also the previous behavior was non-deterministic if there was more than 1, which is definitely no good.\n\nI mean I can add an elif \u003e1 here and change the failure message in that case if you want. That\u0027s simple enough.","commit_id":"42860da4fe239489afaa7edf81c1430513f5392a"},{"author":{"_account_id":1192,"name":"David Kranz","email":"dkranz@redhat.com","username":"david-kranz"},"change_message_id":"397975cbcf31f03ee5b8945ab400d0778838fc14","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        raise exceptions.InvalidConfiguration()"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    # Check that a network exists, else raise an InvalidConfigurationException"},{"line_number":59,"context_line":"    if len(networks) \u003d\u003d 1:"},{"line_number":60,"context_line":"        network \u003d sorted(networks)[0]"},{"line_number":61,"context_line":"    else:"},{"line_number":62,"context_line":"        msg \u003d \"Network with name: %s not found\" % name"}],"source_content_type":"text/x-python","patch_set":6,"id":"7ad32947_518d337a","line":59,"in_reply_to":"bab921fb_5fd70623","updated":"2015-04-27 17:31:59.000000000","message":"I think that would be great. I agree it represents a more serious problem but think we should err on the side of detecting and reporting such problems.","commit_id":"42860da4fe239489afaa7edf81c1430513f5392a"}]}
