Introduce AuthFailure EC2 error code

AuthFailure is a valid EC2 error code, use it where appropriate.

Add 'AuthFailure' ec2_code attribute to NotAuthorized exception.

Return AuthFailure during Keystone authentication errors and add unit
tests to cover this. When Keystone returns HTTP error code, use
the same code for EC2 error response.

Implements: blueprint ec2-error-codes

Change-Id: I17306d9a5364e095e787dbf0dbb5b88a899372e3
Introduce IncorrectState EC2 error code

'IncorrectState' ec2_code attribute was added to ImageNotActive and
VolumeUnattached exceptions.

ImageNotActive is now used instead of useless EC2APIError.

Although IncorrectState EC2 error code is used for volumes only in
Amazon EC2, it's used for incorrect image state in nova as well
because there is no error code for this (EC2 images are stateless)
and inventing new error code is a bad idea.

Implements: blueprint ec2-error-codes

Change-Id: I3566bbc4b2eb13482c93933932dd619f90cbc234
Introduce SecurityGroupLimitExceeded EC2 error code

SecurityGroupLimitExceeded is a valid EC2 error code. Add it as an ec2_code
attribute to the exception of same name and use it where appropriate
instead of useless EC2APIError.

Implements: blueprint ec2-error-codes

Change-Id: I1558b9f69c912dab9d829aacd5c5aae1c37f12b9
Introduce UnsupportedOperation EC2 error code

'UnsupportedOperation' ec2_code attribute was added to following
exceptions that are OpenStack specific and don't have mapping to EC2
error codes because EC2 simply doesn't encounter these problems at all.

 * CannotDisassociateAutoAssignedFloatingIP
 * FloatingIpAssociated
 * FloatingIpNotFound
 * NoFloatingIpInterface
 * NoMoreFixedIps
 * InvalidVolume

Catch these direcly in Executor instead of translating them to useless
EC2APIError. This way, user will also get meaningful error messages.

Implements: blueprint ec2-error-codes

Change-Id: I62ea97658cee85e5285f55cba600a08d01fe7cdd
Introduce InternalError EC2 error code

New InternalError exception with 'InternalError' ec2_code attribute was
introduced for the case of timeout when waiting for instance to stop
because there is no fitting existing exception.

InternalError is a valid EC2 error code. Unlike the other implemented
error codes, it's a server error with 500 status code. For that reason,
it's not listed as an expected error in the Executor and thus it's
treated as an unexpected error - it's logged as ERROR and returned
with 500 status code. That is a wanted behaviur because this shouldn't
ever happen and if it does, it should be visible.

Implements: blueprint ec2-error-codes

Change-Id: I11d25abfe46f5b3acdecb4fa2d31f4cec054cba1
Remove EC2 postfix from InvalidInstanceIDMalformedEC2

With new EC2 error code handling based on ec2_code attribute,
there is no justification for the EC2 postfix.

Implements: blueprint ec2-error-codes

Change-Id: I97ede9a3bcba3a6ac48de50fb6f451f8357a4848
Add dict and list utility functions for object typing

This adds list_of_strings_or_none() and dict_of_strings_or_none()
to objects.utils. This makes it easy to enforce things like
metadata chunks and lists of hostnames.

Related to blueprint compute-api-objects

Change-Id: Iecd40c12da81f4f69312182d619cc12d071137a1
Add Aggregate object model

This adds an Aggregate object model implementation.

Related to blueprint compute-api-objects

Change-Id: Ic947718766181f8262fcf171b2bc0c329e0ae8f9
Merge "Introduce AuthFailure EC2 error code"
Merge "Introduce IncorrectState EC2 error code"
Merge "Introduce SecurityGroupLimitExceeded EC2 error code"
Merge "Introduce UnsupportedOperation EC2 error code"
Merge "Introduce InternalError EC2 error code"
Merge "Remove EC2 postfix from InvalidInstanceIDMalformedEC2"
Merge "Add dict and list utility functions for object typing"
Merge "Add Aggregate object model"