)]}'
{"nova/api/openstack/compute/floating_ips.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6a7da297a45e883e3d19488ba977600ecc798c14","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \u0027pool\u0027: floating_ip[\u0027pool\u0027],"},{"line_number":46,"context_line":"    }"},{"line_number":47,"context_line":"    try:"},{"line_number":48,"context_line":"        if \u0027address\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":49,"context_line":"            result[\u0027fixed_ip\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027address\u0027]"},{"line_number":50,"context_line":"        else:"},{"line_number":51,"context_line":"            result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":52,"context_line":"    except (TypeError, KeyError, AttributeError):"},{"line_number":53,"context_line":"        result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":54,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_ee42490e","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":37},"updated":"2016-01-15 15:18:17.000000000","message":"The code already do this via the exception handling - why do we need to add this check?","commit_id":"6cbb3bfb8ad20b8b448cb5190957ae7da7289752"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"9361c066aa3ad5fc1336fede1ced85b02cde7cf5","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        \u0027pool\u0027: floating_ip[\u0027pool\u0027],"},{"line_number":46,"context_line":"    }"},{"line_number":47,"context_line":"    try:"},{"line_number":48,"context_line":"        if \u0027address\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":49,"context_line":"            result[\u0027fixed_ip\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027address\u0027]"},{"line_number":50,"context_line":"        else:"},{"line_number":51,"context_line":"            result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":52,"context_line":"    except (TypeError, KeyError, AttributeError):"},{"line_number":53,"context_line":"        result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":54,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"da6ed579_bf10fd59","line":51,"range":{"start_line":48,"start_character":0,"end_line":51,"end_character":37},"in_reply_to":"da6ed579_ee42490e","updated":"2016-01-15 16:52:06.000000000","message":"So, this is fun, but it actually doesn\u0027t. floating_ip and floating_ip[\u0027fixed_ip\u0027] are both versioned objects. If fixed_ip is in the floating ip, but does not have an address or instance_uuid, it will raise NotImplementedError because it is unset. Things just get out of whack when these things look like dicts, but we\u0027re using the overridden __contains__() on NovaObject to see if address and instance_uuid are set on the fixed_ip object. I should probably comment in this because this dict syntax is very misleading.\n\nThough you did help me find a bug. If fixed_ip isn\u0027t set on floating_ip, then that if check will still fail by something that isn\u0027t caught in the except.","commit_id":"6cbb3bfb8ad20b8b448cb5190957ae7da7289752"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"be22a0fbaef8b1d360bee2b99c9a24320249b298","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    # caught by the exceptions below (it raises NotImplementedError and"},{"line_number":58,"context_line":"    # OrphanedObjectError. This comment can probably be removed when"},{"line_number":59,"context_line":"    # the dict syntax goes away."},{"line_number":60,"context_line":"    try:"},{"line_number":61,"context_line":"        if \u0027address\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":62,"context_line":"            result[\u0027fixed_ip\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027address\u0027]"},{"line_number":63,"context_line":"        else:"},{"line_number":64,"context_line":"            result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":65,"context_line":"    except (TypeError, KeyError, AttributeError):"},{"line_number":66,"context_line":"        result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":67,"context_line":"    try:"},{"line_number":68,"context_line":"        if \u0027instance_uuid\u0027 in floating_ip[\u0027fixed_ip\u0027]:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_7a236c56","line":65,"range":{"start_line":60,"start_character":4,"end_line":65,"end_character":10},"updated":"2016-02-02 05:59:03.000000000","message":"Why do we need try-except here still?\n\nIn addition, if pre-getting fixed_ip from floating_ip like\n\n fixed_ip \u003d floating_ip[\u0027fixed_ip\u0027]\n\nthe code can be reduced like\n\n if \u0027address\u0027 in fixed_ip:\n     result[\u0027fixed_ip\u0027] \u003d fixed_ip[\u0027address\u0027]\n else:\n     result[\u0027fixed_ip\u0027] \u003d None\n\n if \u0027instance_uuid\u0027 in fixed_ip:\n     result[\u0027instance_id\u0027] \u003d fixed_ip[\u0027instance_uuid\u0027]\n else:\n     result[\u0027instance_id\u0027] \u003d None","commit_id":"d40f75761225fdf99cf960e1b9d90c8e85e32dad"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"be22a0fbaef8b1d360bee2b99c9a24320249b298","unresolved":false,"context_lines":[{"line_number":64,"context_line":"            result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":65,"context_line":"    except (TypeError, KeyError, AttributeError):"},{"line_number":66,"context_line":"        result[\u0027fixed_ip\u0027] \u003d None"},{"line_number":67,"context_line":"    try:"},{"line_number":68,"context_line":"        if \u0027instance_uuid\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":69,"context_line":"            result[\u0027instance_id\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027instance_uuid\u0027]"},{"line_number":70,"context_line":"        else:"},{"line_number":71,"context_line":"            result[\u0027instance_id\u0027] \u003d None"},{"line_number":72,"context_line":"    except (TypeError, KeyError, AttributeError):"},{"line_number":73,"context_line":"        result[\u0027instance_id\u0027] \u003d None"},{"line_number":74,"context_line":"    return {\u0027floating_ip\u0027: result}"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a5de9d1_5a1470e7","line":72,"range":{"start_line":67,"start_character":4,"end_line":72,"end_character":10},"updated":"2016-02-02 05:59:03.000000000","message":"ditto","commit_id":"d40f75761225fdf99cf960e1b9d90c8e85e32dad"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3f490792d4d5672a27d11c691d920f23b50ba407","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # objects, so we need to do these contain checks because they will not be"},{"line_number":57,"context_line":"    # caught by the exceptions below (it raises NotImplementedError and"},{"line_number":58,"context_line":"    # OrphanedObjectError. This comment can probably be removed when"},{"line_number":59,"context_line":"    # the dict syntax goes away."},{"line_number":60,"context_line":"    try:"},{"line_number":61,"context_line":"        if \u0027address\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":62,"context_line":"            result[\u0027fixed_ip\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027address\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_2b03bc0e","line":59,"updated":"2016-03-30 13:59:37.000000000","message":"Hmm, I\u0027m not sure that making instance and fixed just be missing if we know they are not assigned was the right call. However, that\u0027s a bigger question.","commit_id":"391dc51606e340e9bfc6040b6f3b2bb3b6a1c100"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"738cfb0f8a2d8296dfe00e851f86963bd9cfafa1","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    # objects, so we need to do these contain checks because they will not be"},{"line_number":57,"context_line":"    # caught by the exceptions below (it raises NotImplementedError and"},{"line_number":58,"context_line":"    # OrphanedObjectError. This comment can probably be removed when"},{"line_number":59,"context_line":"    # the dict syntax goes away."},{"line_number":60,"context_line":"    try:"},{"line_number":61,"context_line":"        if \u0027address\u0027 in floating_ip[\u0027fixed_ip\u0027]:"},{"line_number":62,"context_line":"            result[\u0027fixed_ip\u0027] \u003d floating_ip[\u0027fixed_ip\u0027][\u0027address\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"ba0121b8_24de2ddd","line":59,"in_reply_to":"ba0121b8_2b03bc0e","updated":"2016-03-31 00:58:56.000000000","message":"Ugh. So this is all wrong. Looking at the chain of calls, it appears that this is handed a floating IP from network.API.get_floating_ip(). Looking at https://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L1343-L1357 (for the neutron case), it gets the floating IP from neutron, and passes it to _format_floating_ip_model(), which converts it to a dictionary. So this *isn\u0027t* an object.","commit_id":"391dc51606e340e9bfc6040b6f3b2bb3b6a1c100"}]}
