Fix delete event error in postgres

An error happens when heat delete events in postgres,
 It seems that JOIN/DELETE is not supported in
"sqlalchemy/orm/".

Let heat delete events in postgres in the common
way.

Closes-Bug: #1301827
Change-Id: Id320abf15c4fd9f58e411ad7de7f044a9b5d1c1e
Enable lazy translation in unit tests

Change-Id: Ia2aaaaae34f0f234b2493e7c724d7b874035bcfb
Synced jsonutils from oslo-incubator

The sync includes change that drastically enhances performance on Python
2.6 with fresh simplejson library installed.

The latest commit in oslo-incubator:
- 732bdb6297eb9de81667f7713ebcb1ccc2ee45a7

Change-Id: Ib3dc0b713ed90396919feba018772243b3b9c90f
Closes-Bug: 1314129
Add a test equivalent to default_log_levels

This is to mainly kill the migrate script logs
but can be used to quieten down any log.
Also the migrations were not using the FakeLogger
so now both are using the same mechanism.

Fixes-bug: 1281226
Change-Id: I2f1efcace6a38450020fcbf516ee5026204359d2
Using new attribute schema for all resources

Currently resources use old style of attribute schema. For example:

    attribute_name: _('Description')

This patch contains changes to migrate for new attribute Schema class.
For example:

    attribute_name: attributes.Schema(_('Descriprion'))

Partial-Bug: #1307319

Change-Id: I54c7b9d481655b0051d0f7ff668672011ac882e9
Fix stack_resource's handle_adopt

- This changes a call from (non-existing) _to_parameters()
  to child_params() like the other surrounding calls to
  create_with_template()
- Also add a missing check_adopt_complete to stack_resource

Change-Id: I4ab9c299bf41d057f85b59dfdffa985e07a15bac
Make attributes definition similar on properties

Current attributes_schema contains hard codeded names of attributes.
This patch replaces all hard coded names on variables defined in
ATTRIBUTE tuple.

Change-Id: I1ea7b33bd598dba07f2190c282497c573463b0dd
Partial-Bug: #1307319
Fix broken link to API reference

The link to the API reference was pointing to api-ref-orchestration,
which is incorrect.  This changes it to api-ref-orchestration-v1.

Closes-Bug: #1320956
Change-Id: I3eb46af60dffc47e62ffbfc9f407f7f1a86a56a1
Move API parameter parsing from OpenStack API to engine

In commit 4169c1bd8ce4db0a794e22471994ea401b77b9c0, the API parameter
parsing was moved to the OpenStack API.  Since then, inputs to the CFN
API were not being validated, creating a security hole.

Change-Id: I21920591075bcefbe695316dab6605afd6f4ec64
Closes-Bug: #1317667
Do not validate constraints in schema constructor

This patch moves validation of constraints out of the constructor of
schema objects into a separate method that can be invoked on the
schema objects after creation. This gives us more control over when
validation shall be invoked.

This patch fixes an issue with custom constraints that could not be
validated when having a default value, since they require the RPC
context to be present. However, the context was not present in the
places where needed.
The short-sighted fix would have been to change a lot of method
signatures to pass the context properly, but that did not seem to be
really clean. The better fix seemed to be to move validation into
a separate method that can be invoked with the proper context. This
will also give us more control on when we do validation, and which
validation we do.

This patch
Closes-Bug: #1314240

This patch will also enable to fix
Partial-Bug: #1314401

For that bug it will be necessary to switch off validation under
certain conditions, which was not possible before when doing
validation right in the constructor.

Change-Id: I19e1fb520551eb42bf36bb380f1cc28c81bbaedd
Add range constraint to AWS volume size

Such constraint was added to OS::Cinder::Volume but was missing
from its AWS counterpart.

Related-Bug: #1267747
Change-Id: Ie2c85b6eed43793302a64cb1f8c44e6e413e69ef
Refactor neutron resources lookup

This patch moves new neutron resources resolution methods
of basic neutron resource to a separate module neutron_utils
(similar to nova_utils) for easier usage in other parts of the code.

Change-Id: Ifb2e103e6b66dd021e24eb48c816b8c46da921e1
Revert "Default engine workers to the number of CPUs"

This reverts commit 56041687844c7c04bfcad974a07ac3ff35f99e5c.

Problems have been reported on systems using QPID. The gate only tests
RabbitMQ.

Change-Id: Iaf83dc7582835ce5bf4534116c918640da7373aa
Partial-Bug: #1321303
Merge "Add range constraint to AWS volume size"
Merge "Do not validate constraints in schema constructor"
Merge "Revert "Default engine workers to the number of CPUs""
Use oslo.config for heat-keystone-setup-domain

Previously used environment variables exclusively.

Change-Id: If4b4266ce66212d7ae2579e7da6d3bae779ad04a
Do no re-validate parameters for existing stacks

This patch disables validation of stack parameters values when
loading existing stacks from the database. The old behavior was
to always validate stack parameter values when initializing a
Stack object. However, this causes problems especially with
custom constraints when a constraint could be fulfilled during
stack creation but cannot be fulfilled at a later point (e.g.
when a flavor or keypair has been deleted). In such a case,
the existing stack became completely unusable.

This patch changes the behavior to not do parameter validation
for existing stacks. The assumption is that validation at stack
creation time should be sufficient to make sure the stack is valid,
so only valid stacks end up in the database. Therefore, validating
parameters again when loading stacks is not really required.

Change-Id: I0947c2dcfb9db4c81b07de582aab86f262d0c008
Closes-Bug: #1314401
Restore resource_id from backup_stack when delete

When UpdateReplace is occured, the resource is moved to backup_stack,
and create new one. Then, resources which has dependency for updated
resource will be moved to backup_stack. If the creation of update is
failed, dependencies between backup_stack and exist_stack will exist.

Heat deletes backup_stack before deleting exist_stack. The dependency
still exists, so it will be failed. Thus, add behavior that restores
resource_id in the backup_stack when the stack is deleted.

Change-Id: Ib2a39fa20089b7140fc676f54db8cf66a4581c60
Closes-bug: #1270775
Merge "Synced jsonutils from oslo-incubator"