diff options
author | Justin Santa Barbara <justin@fathomdb.com> | 2011-02-23 22:50:33 +0000 |
---|---|---|
committer | Tarmac <> | 2011-02-23 22:50:33 +0000 |
commit | cd301d67506bcb6d67d921492435e9d7d56aafb1 (patch) | |
tree | 77667bd9ef0841c3622670ed97d0a63c18e8e7d6 /nova/service.py | |
parent | ed9bdfc8b61470bbe3f61ef7bf3f3044f8483b8a (diff) | |
parent | 8c007b56b586257d048b6db4ecfbed8f502381fd (diff) | |
download | nova-cd301d67506bcb6d67d921492435e9d7d56aafb1.tar.gz nova-cd301d67506bcb6d67d921492435e9d7d56aafb1.tar.xz nova-cd301d67506bcb6d67d921492435e9d7d56aafb1.zip |
Helper function that supports XPath style selectors to traverse an object tree e.g.
inst = {'fixed_ip': {'floating_ips': [{'address': '1.2.3.4'}], 'address': '192.168.0.3'}, 'hostname': ''}
private_ips = get_from_path(inst, 'fixed_ip/address')
public_ips = get_from_path(inst, 'fixed_ip/floating_ips/address')
Avoids messy [.get() / if / for]* nested code
Diffstat (limited to 'nova/service.py')
0 files changed, 0 insertions, 0 deletions