Allow filtering of stacks by action

Currently users can already filter by status.  Since status and action
are so closely tied, it is valuable to be able to filter by action as
well.  As a result, users can filter stacks in a more meaningful way.
For example, /stacks?action=CREATE&status=IN_PROGRESS

Implements: blueprint filter-by-action
Change-Id: I58bf53373e0a9231d198d8fb62e76b1373587b87
Do not use suppport message if it's None

'message' attribute of SupportStatus class has default value equal None.
If you use support_status value in Schema class without providing
'message', you will get in documentation warning in form: DEPRECATED - None.
It looks confused and in such case we should display only 'status'
attribute: DEPRECATED.

Change-Id: I482fe6a9ca134e9e3bc54282b4b10ed98c29b028
Don't ignore event creation errors

Don't catch exceptions when creating events and instead let the error
propagate. Exceptions when storing events could hide programming errors
and doesn't seem to protect against real issues. The patch also fixes
the tests breaking.

Change-Id: I5eef34c0ed20f9700756e479ace6408304d2cebe
Use cinder API for volume attach and detach

Replace nova calls for attaching and detaching volumes
with native cinder API calls.

Closes-Bug: #1298350
Change-Id: I628b4a0dd559389f66ab25b6030a9ad6fc927e39
Allow DesiredCapacity to be zero

When updating or validating a AutoScaleGroup,
'DesiredCapacity' is ignored if the value is 0.

- Add validation for 'DesiredCapacity' if the value is 0,
- Don't ignore zero when updating.

Change-Id: I830aaf97ebed6b2c77c72b18dc8d222ce23f9a28
Partial-Bug: #1304423
Push COMPLETE status change at the end of update

This patch moves the status change of stack update to the very end of
the update task, to avoid a race condition where the status of the stack
is UPDATE_COMPLETE but stack-show could return the previous resources.

Change-Id: I04abcf2e876d1de36a36bcd1596a2fd510669744
Closes-Bug: #1308682
Make template validation uniform

There were two different behaviours during template validation and creation
stack (with template validation). In first case error was raised if
template did not have any resources. However user could create stack
without error using this such kind of template.
This patch make behaviour equal for both variant and gives ability to
create and successfully validate stack with template which does not have
resources.

Change-Id: I4dc30ccdc45e0fa7ff678b434106e056dba5f3b4
Closes-Bug: #1278090
Merge "Do not use suppport message if it's None"
Merge "Allow filtering of stacks by action"
Merge "Make template validation uniform"
Support multiple heatclient versions for SD

The software_deployment resources lazy loads data via the
heatclient _get() function. Not only is this function private
but the oslo-incubator recently reverted things such that
get() should once again be used for lazy loading details.

See oslo-incubator commit 04a1abe59ac39890f57d2eed57d3d1b12bb5d757

This was merged into heatclient master in:

72017c566850da589f7dc7dc275871986aadbd54

This patch makes it so that heat will work with both versions
of heatclient.

Change-Id: I1799636d39cea410b55ffe72eeecba4f4a7a0f80
Closes-bug: #1308770
Avoid redundant polling of DB for metadata

Every time self.metadata is read, it triggers a refresh from the database.
We were accessing it multiple times in a loop, which is not only wasteful
but can get very O(n^2) for a WaitCondition with a high Count.

Partial-Bug: #1306743

Change-Id: I1a82afac6c4ef56dbf87722648034c05abef4010
Fix wrongly printed count of received handled conditions.

The WaitConditionTimeout message was using size of the reason
string as input instead of the actual number of status reasons.

Change-Id: I9ad1813755eda6924ffeff116eaeda9f36b601d1
Closes-Bug: #1297230
Merge "Support multiple heatclient versions for SD"
Merge "Don't ignore event creation errors"
Don't pass enable_snat by default in Router

The patch removes the default for enable_snat in the Router resource and
removes the value if not specified, to make it possible for non-admin
users to create routers: a policy rule in neutron forbids non-admin to
pass the enable_snat value.

It doesn't break backward compatibility as enable_snat is the default in
neutron.

Co-Authored-By: ala.rezmerita@cloudwatt.com
Closes-Bug: #1306593
Change-Id: Ib9d31f7e0a246bcaa663aaa74755526f8e31df7e
Merge "Don't pass enable_snat by default in Router"
Add a log info message in Stack state_set

Adding info message in Stack state_set method.
This message would help in searching log files for stack
operations.

Change-Id: Idf462286530f235b954c2bf7fda134a8e02b0bd2
Merge "Use cinder API for volume attach and detach"
Merge "Fix wrongly printed count of received handled conditions."