Add new attributes to floating ips

There are four attributes that show up by default in devstack installs.
They come from the timestamp and standard attributes extensions, so it's
possible they may not always be present. But we can make them always be
present.

Change-Id: I1a05ef735c24600821856c6ec36df11e981b3d36
This commit is contained in:
Monty Taylor 2016-12-13 07:45:12 -06:00
parent a868c0a81b
commit 65f3d49cf7
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 19 additions and 0 deletions

View File

@ -202,6 +202,7 @@ A Floating IP from Neutron or Nova
FloatingIP = dict( FloatingIP = dict(
location=Location(), location=Location(),
id=str(), id=str(),
description=str(),
attached=bool(), attached=bool(),
fixed_ip_address=str() or None, fixed_ip_address=str() or None,
floating_ip_address=str() or None, floating_ip_address=str() or None,
@ -209,6 +210,9 @@ A Floating IP from Neutron or Nova
port=str() or None, port=str() or None,
router=str(), router=str(),
status=str(), status=str(),
created_at=str() or None,
updated_at=str() or None,
revision_number=int() or None,
properties=dict()) properties=dict())
Project Project

View File

@ -0,0 +1,4 @@
---
features:
- Added support for created_at, updated_at, description
and revision_number attributes for floating ips.

View File

@ -468,6 +468,13 @@ class Normalizer(object):
router_id = ip.pop('router_id', None) router_id = ip.pop('router_id', None)
id = ip.pop('id') id = ip.pop('id')
port_id = ip.pop('port_id', None) port_id = ip.pop('port_id', None)
created_at = ip.pop('created_at', None)
updated_at = ip.pop('updated_at', None)
# Note - description may not always be on the underlying cloud.
# Normalizing it here is easy - what do we do when people want to
# set a description?
description = ip.pop('description', '')
revision_number = ip.pop('revision_number', None)
if self._use_neutron_floating(): if self._use_neutron_floating():
attached = bool(port_id) attached = bool(port_id)
@ -487,6 +494,10 @@ class Normalizer(object):
port=port_id, port=port_id,
router=router_id, router=router_id,
status=status, status=status,
created_at=created_at,
updated_at=updated_at,
description=description,
revision_number=revision_number,
properties=ip.copy(), properties=ip.copy(),
) )
# Backwards compat # Backwards compat