Fix status reason in events for deployment signals

When a signal is received and processed by a Resource, there could be an
event generated automatically. For such an event, Heat is supposed to
provide some useful message (including status_reason).  But currently,
the resource code can only process ceilometer alarms and watch rules,
for signals sent for a SoftwareDeployment resource, the signal is only
providing an string 'Unknown' as the status change reason.  This is
confusing when a user performs 'heat event-list stack'.

This patch adds an additional check (guess) whether the signal comes
from a SoftwareDeployment.  If that is the case, fill in the status
reason as 'deployment succeeded', or 'deployment failed (n)', where n is
the deploy_status_code that comes with the signal.

Closes-Bug: #1300679
Change-Id: Ic970a5dac923fffdcdd365983df58f4d338de849
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
Validate user_data_format for server with deployment

Validation error will be raised if user_data_format is not set
correctly.

Partial-Bug: #1295536
Change-Id: I0509c9c3a71d09fa8e2113710d561ffd3289d814
Enable lazy translation in unit tests

Change-Id: Ia2aaaaae34f0f234b2493e7c724d7b874035bcfb
Move API parameter parsing from engine to API

API parameter parsing should be done in the API rather than the engine.

Change-Id: I133f419bbb73964b461572d8cadd300233af9c12
Change volume size property type to integer

Before it was possible to provide a rational number for SIZE, but cinder
would silently round it down, which leads to inconsistency between
stored resource state and actual cinder volume.

Closes-Bug: #1311707
Change-Id: I97b110f9797e2046bd5d2ae7da227b8dfc19059a
Fix validate failed with an image_name in uuid format

We should support to get the image_id by an image_name which is in uuid
format.

Change-Id: I471ee57ea55f990f852398a43762899dbc3d8692
Closes-Bug: #1312523
Remove unused logger

There are a lot of files contain import logging which is used for
creating logger object. However in some files we only have definition of
logger without using him. In this patch all unused loggers and imports
are deleted.

Change-Id: Iedba6d40850cb050c5c25d9b8a6a1d7128fd4bee
Prefetch data in resource_get_by_name_and_stack

This loads resource and resource data in a single query, which means
one less sql query per stack resource in a call to describe_stack_resource.

Change-Id: Ic2e1ab68cf651f290be75206fd5c0c841de4ef82
Related-Bug: #1306743
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
tests remove stack_delete_after decorator

This is no longer required because cleanup is provided via reset
of the dummy db in all tests which call the base-class setUp.

Change-Id: I49cbfce0b2880d0318114df35d4abaed61d03bfc
Refactor boolean conversion into a separate function

A method to convert API parameters to boolean values will be useful for
parsing the show_deleted API parameter, so create a separate function
named extract_bool.

blueprint stack-list-soft-deleted

Change-Id: I1bce5516b0a8c97d6c08607922968454d94b4406
Don't dynamically create provider types in the global env

Only support this in user environments.
Note: this is only when you have the following in your template
resources:
  thingy:
    type: http://example.com/foo.template

Doing this will avoid tenant-specific provider template URLs being
shown globally in the resource-type listing.

Co-Authored-By: Angus Salkeld <angus.salkeld@rackspace.com>
Closes-Bug: #1311223
Change-Id: Ifa18108afacbda390b19b46a8f41bc4f018e95d6
Engine changes for API param to show soft-deleted stacks

blueprint stack-list-soft-deleted

Change-Id: Ie649d9a2b4132795e048325dedc46900c6f34eac
API changes for param to show soft-deleted stacks

blueprint stack-list-soft-deleted

Change-Id: I9b56ee877746c25c6acefb91fc3eae63701aedd6
Use the new oslotest library

There is a new support library extracted from oslo incubator: the patch
starts using it and removes deprecated modules.

Change-Id: I3839af20613ff6ab905dddb8fc4be65654c6e949
Merge "tests remove stack_delete_after decorator"
Merge "Remove unused logger"
Merge "Prefetch data in resource_get_by_name_and_stack"
Merge "Change volume size property type to integer"