Merge lp:~jtran/nova/lp810364 into lp:~hudson-openstack/nova/trunk
Proposed by
John Tran
Status: | Merged |
---|---|
Approved by: | Rick Harris |
Approved revision: | 1329 |
Merged at revision: | 1352 |
Proposed branch: | lp:~jtran/nova/lp810364 |
Merge into: | lp:~hudson-openstack/nova/trunk |
Diff against target: |
31 lines (+7/-2) 2 files modified
nova/api/openstack/contrib/floating_ips.py (+2/-2) nova/tests/api/openstack/contrib/test_floating_ips.py (+5/-0) |
To merge this branch: | bzr merge lp:~jtran/nova/lp810364 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rick Harris (community) | Approve | ||
Jason Kölker (community) | Approve | ||
Brian Waldon (community) | Approve | ||
Review via email: mp+69396@code.launchpad.net |
Commit message
code was checking for key in sqlalchemy instance and will ignore if value is None, but wasn't working if floating_ip was a non-sqlalchemy dict obj. Therefore, updated the error checking to work in both caes.
Description of the change
code was checking for key in sqlalchemy instance and will ignore if value is None, but wasn't working if floating_ip was a non-sqlalchemy dict obj. Therefore, updated the error checking to work in both caes.
To post a comment you must log in.
What do you think about this code, instead? It will handle floating_ip not being a dictionary and the 'address' key not existing:
try:
result[ 'fixed_ ip'] = floating_ ip['fixed_ ip']['address' ]
result[ 'fixed_ ip'] = None
except (TypeError, KeyError):