)]}'
{"shade/meta.py":[{"author":{"_account_id":2,"name":"Monty Taylor","email":"mordred@inaugust.com","username":"mordred"},"change_message_id":"bb20a117b742b9ba20594627d311c01d53228ab8","unresolved":false,"context_lines":[{"line_number":304,"context_line":"        return server[\u0027public_v6\u0027]"},{"line_number":305,"context_line":"    elif server[\u0027public_v4\u0027]:"},{"line_number":306,"context_line":"        return server[\u0027public_v4\u0027]"},{"line_number":307,"context_line":"    return get_server_ip(server)"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":""},{"line_number":310,"context_line":"def get_groups_from_server(cloud, server, server_vars):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df87a7cf_64de57db","line":307,"updated":"2017-12-18 17:33:44.000000000","message":"The call needs to be:\n\n  return get_server_ip(\n    server, public\u003dTrue,\n    cloud_public\u003dnot cloud.private)\n\nBecause we need to not return a private IP for interface_ip if the calling context cannot route to that location. (this would break ansible openstack dynamic inventory, for instance)\n\nWe should also probably plumb through an additional flag that this should pass:\n\n  return get_server_ip(\n    server, public\u003dTrue,\n    cloud_public\u003dnot cloud.private,\n    fallback\u003dFalse)\n\nThen:\n\n  def get_server_ip(..., fallback\u003dTrue)\n\n  def find_best_address(..., fallback\u003dTrue)\n\nand finally at the bottom of find_best_addresses:\n\n  if fallback:\n      return addresses[0]\n  else:\n      return None\n\nThis should allow public and private ips to be returned if the node that is executing the code can route to them, but should continue to not set interface_ip to a value that the caller cannot reach.\n\nAlso- yes, this is highly complex and messy and could really use a top-to-bottom refactor - as well as some more tests. Like, the fact that returning a non-routable private ip as a fallback would break ansible doesn\u0027t have a unit test.","commit_id":"d40bde832babba26ba48fa181368c8cb58a10085"}]}
