Yelp/Tron — pull request #260 by Codeacious (2013-07-31 01:18:33+00:00)
Title: Fixed service data to use node.name, with backwards compatibility

Ignore the commit message, it'll confuse you.

This is a fix for #252. It simply changes service instances to use `node.name` in their state data, instead of `node.hostname`. The `node_selector` function in `serviceinstance.py` has been changed to attempt to first look up a node by name, then by hostname, and then finally going to just the next_node (previously, it would only look up by hostname).

This way, services will start to get their state_data saved with node.name, but anything that doesn't get updated for a very long time will still be okay.

Once this has been out for a while (probably for at least two releases), looking up by hostname should be removed (just take out the `or node_pool.get_by_hostname(hostname)` block of the return statement).