Bug Description

This is probably low priority, as it's fairly easy to work around, but this will bite us one day when we have a property when null is not the same as the empty string.

The way metadata is returns is inconsistent between the images detail list and the metadata headers on the image...

In particular, below you can see that disk_format is null in the JSON, but in the header it is returned as the empty string. I think the header should not be returned, because otherwise you can't tell Null and "" apart. For now, it's fairly easy to assume that "" => None though, but this may not always be valid.

Justin, could you create a test case that is able to reproduce the behaviour you are seeing? This is very concerning for me... as there should be default values inserted if no disk_format or container_format is given.

For images created via the glance CLI, the container and disk formats
were previously defaulted if not explicitly set. However if created via
the python or REST APIs, these attributes were not defaulted if unset.

There is no real sensible default for these formats, so now an image
create fails with 400 "Bad Request" if the format metadata are missing.

Also we ensure unset image metadata are not reported in x-image-meta-*
headers in order to disambiguate None and empty string values.