Add API endpoint to query build information

This creates the '/<tenant_id>/build_info' endpoint and returns the build revision
as defined in the 'heat_revision' configuration option. This provides
both the revision of the engine and the api:

{
  "api": {
    "revision": <api revision>
  },
  "engine": {
    "revision": <engine revision>
  }
}

Implements: blueprint heat-build-info
Change-Id: Ibb2f5afda7c5d7c314e5e062d618405d9f4eb318
Remove external AWS links and add doc if needed.

Closes bug #1252640

Change-Id: Ifae43c7ba457e8962360dd5b70cbb8b202365eee
Avoid eventlet-unsafe exception handling

Eventlet can context-switch during a log call (at least in principle).
Therefore it is unsafe to use "raise" after this call, because the exception
raised may not be the same one caught by the "except" block, but rather
could be any random exception from some other greenlet.

This is a canonical example of why eventlet is pure evil.

Fixes bug: #1255506

Change-Id: Ieb0eb763c0fd696b82212653ac4909d2bddf6b88
Make engine service docstrings conform to Sphinx

This allows our Sphinx-generated documentation to render the
parameters correctly.

There were some errors in some of the "argN"-documented
functions, so I've updated them to include all the parameters.

Change-Id: Ic3b2c7702331bc85744b24434edbb2656c90916a
VersionNegotiation - 404 if no version is provided

The version negotiation middleware tries to identify the API version for
a specific url, and then perform routing. It also provides version info
if you attempt to reach "/versions". However, it also returns version
info if you attempt to reach any other endpoint that does not match a
version url.
The version negotiation middleware was modified in order to return all
the available versions of the api only when:
 1- No version is present in the URI and the Accept HTTP Header
 2- The request path is / or /versions
If the version is not provided and the request path is other than the
two mentioned earlier a 404 HTTP Code is returned.
If a version is provided the middleware strips the version from the URI and
pass the request to the next middleware/app.
Added a test suite to ensure that the Version Negotiation Middleware
work as expected.

Change-Id: I1dde1304de60533491790c33db7d2f74d3373722
Closes-Bug: #1251078
Fn::Replace support for type Number

Currently Fn:Replace works just with type String:
{Fn:Replace [{'str': 'new_str'}, 'change str']}

After this fix it will work for type Number:
{Fn:Replace [{'str': 42}, 'change str']}

Change-Id: I709a3350b5676bd9db8bac92e07ad105466bd187
Closes-Bug: #1256326
Derive context is_admin from policy

Use a rule in the policy.json to correctly derive a user's admin-ness
based on their roles, when it is not explicitly specified in the
RequestContext constructor.

Keystone auth_token tests X-Roles based on the user role membership
for the tenant the token is scoped to, so this will allow us to define
per-tenant admins (the admin everywhere issue described in keystone
bug #968696 won't apply here, that is specific to keystone).

Remove the admin_role config option, which doensn't do anything, and
now this should be specified via policy.json.

Change-Id: I1921a2b515ecc8ca5d37205e3cdb6b7b8695b1ac
bluprint: request-scoping-policy
Remove misleading docstrings in ContextMiddleware

Most of this information is completely wrong, so remove it

Change-Id: I00cc4eae20447c402f1451fe9aa7d72877f2c36c
Remove owner_is_tenant from RequestContext

This appears to be a leftover from glance, and we don't support
anything other than tenant-scoped requests.

Change-Id: Ibce0e38ee24f18de24733a35d25c90c03b46dc6e
blueprint: request-scoping-policy
Fix show_deleted errors in RequestContext

get_admin_context takes a read_deleted argument which is ignored,
and we don't include the read_deleted value in to_dict output.
Fixing this means we can respect this flag in the DB API, which
currently we do not.

Change-Id: Id0906983b93cd2526580942390f7992fb2cb5504
blueprint: request-scoping-policy
Migrate away from rackspace_resource

Having Rackspace specific resources subclass a the rackspace_resource
does not replace the clients system wide. Use the cloud_backend to
acomplish this. That way any special configuration done with pyrax
will be used in any client call.
Change-Id: Ia6d548e606a42c608135cb66876419d1b339a06c
Remove property decorator in TemplateResource

These methods can do quite a bit of work and treating
them as properties seems a bit odd.

Change-Id: I99cc3c9f74f59f9984daa3e128651926830e9d29
Remove duplicate test scenario

This is causing the gate to fail, maybe because of a new version
of testr.

Change-Id: Ice03d848118638f56f7df36ce08b3a68c371dd2c
Merge "VersionNegotiation - 404 if no version is provided"
Remove unused fake test code

This just confuses everyone.

bug: #1195452
Change-Id: I9d8524a7619663e5f0e5cce619a0587290ff1db7
Add a .coveragerc to exclude tests and oslo

This is to try produce more relevant output.

Change-Id: I08ebfacf19e4975e00ab79229cc18a3b57a1002a
Sync DB2 error code handling from oslo

Including DB2 error code -30081 in conn_err_codes, so that the
connection retry code will not be skipped when DB2 connection
error happens.

SHA1 of Oslo commit - bdabd512943ebb84a1333b2b3ee31a33124af76e to
which the db module code is syncd.

Change-Id: Idec7a6d712f5ed08fc0daad0a64df203c624f194
Closes-Bug: #1244092
Merge "Make engine service docstrings conform to Sphinx"
Merge "Remove property decorator in TemplateResource"
Factor Schema out of properties.py for re-use

There is currently some function duplication in Heat for schema
validation. There is properties.Schema and a ParamSchema class which
do mostly the same, but each with their own code.
It would be good to have a common implementation for property and
parameter validation with only property or parameter specific code
implemented in sub-classes.
The current Schema class in properties.py cannot be used in
parameters.py due to cyclic import dependencies that would arise.

This patch factors the Schema class and Constraint classes into their
own file which can then be imported by both properties.py and
parameters.py. For property schema specific code, a class
PropertySchema is introduced as derived from the common Schema class.

The code of the Schema and Constraint classes is unchanged except for
absolutely  refactoring work.

In a subsequent patch, I plan to provide the code to base ParamSchema
on the common Schema class.

Change-Id: I833edd8fad316220f56d6727fe1e3409f8fda6ee
Partial-Bug: #1230229