I believe this is a matter of implementation. In nova/api/ec2/apirequest.py:166, we _render_data according to the data class:
if isinstance(data, list):
for item in data: data_el.appendChild(self._render_data(xml, 'item', item))
elif isinstance(data, dict): self._render_dict(xml, data_el, data)
elif hasattr(data, '__dict__'): self._render_dict(xml, data_el, data.__dict__)
elif isinstance(data, bool): data_el.appendChild(xml.createTextNode(str(data).lower()))
elif data != None: data_el.appendChild(xml.createTextNode(str(data)))
However, we never actually check to see if the data is a datetime instance (which is what comes out of our database). By adding these two lines (before the final elif date != None):
I believe this is a matter of implementation. In nova/api/ ec2/apirequest. py:166, we _render_data according to the data class:
if isinstance(data, list):
data_ el.appendChild( self._render_ data(xml, 'item', item))
self. _render_ dict(xml, data_el, data)
self. _render_ dict(xml, data_el, data.__dict__)
data_ el.appendChild( xml.createTextN ode(str( data).lower( )))
data_ el.appendChild( xml.createTextN ode(str( data)))
for item in data:
elif isinstance(data, dict):
elif hasattr(data, '__dict__'):
elif isinstance(data, bool):
elif data != None:
However, we never actually check to see if the data is a datetime instance (which is what comes out of our database). By adding these two lines (before the final elif date != None):
elif isinstance(data, datetime.datetime):
data_ el.appendChild( xml.createTextN ode(data. isoformat( )))
I believe we will catch _all_ the dates (not sure if there are any others in the responses) and convert them to ISO format.
We need to add this type of parsing to our integration tests.