Set rollback status early in update if triggered

Before when rollback was triggered during stack update, the stack continued to
have status UPDATE_IN_PROGRESS, and only at the very end flipped to
ROLLBACK_COMPLETE.
This patch sets the stack state to ROLLBACK as soon as
rollback is started to notify the user properly on the action being
performed.

Change-Id: Idbd78a3a2a8d0c32fb26c7d0c38c87857d1565d8
Closes-Bug: #1316558
Heat and Openstack incomplete documentation

Improve documentation running a heat template with devstack

Change-Id: Ifb6abd30a882d4c5197090c87498781702488b9c
Closes-Bug: #1326089
ec2token tolerate fully-qualified ec2authtoken auth_uri

If (as is currently done by the puppet-heat manifiests) the ec2authtoken
auth_uri is specified, and it looks like http://127.0.0.1:5000/v2.0/ec2tokens
ec2token authentication will fail, because we always append "ec2tokens" to
the auth_uri.  Instead, only add it when needed.

This probably needs to be combined with a change to the puppet manifiests so
we don't set the ec2authtoken auth_uri, as it's an optional section - we can
derive the correct path with only the auth_uri from the keystone_authtoken
section.

Change-Id: I8c89772b40523b30f1c46b2ca8b68f9e20d5c213
Closes-Bug: #1318599
Fix property-parameter mapping for boolean property

resource-template returns wrong parameter type "string" for
boolean property, which is wrong after boolean-parameter-type
(commit:6984a7793883164af0e28c3e707048e989670e9d) was merged.
boolean property should be mapped to parameters.Schema.BOOLEAN

Change-Id: I9841545a8e740ecf5ba1806e807bbe15feede69f
Closes-Bug: #1328022
Deprecate old schema definition in dbinstance

using new schema definition for dbinstance in test_dbinstance.py,
the old definition is deprecated.

Change-Id: I648074ff9c7d84af5dc5b3765642244fcf7a870f
Respect schema data type in constraint validation

This patch makes Constraint objects aware of the data type of the
owning Schema object so constraint validation can apply potential
type casts based on the data type.
This is especially useful and necessary for an AllowedValues
constraint and numeric values, where items may be defined as
strings or numbers and cause comparison issues with user values
at runtime.

Change-Id: Id1884b4968993fc9356e7ba4ad03dced4cd00d4e
Closes-Bug: #1321540
Add AllowedValues constraint to Rackspace::Cloud::LoadBalancer

The Rackspace Cloud Load Balancer service only allows certain
values for the algorithm property. This patch adds constraints
so that users get validation feedback prior to creating the
resource.

Closes-Bug: #1328654
Change-Id: Id24b426b1d3e49b09b3e468ea9e9675c05eaa160
parser.Stack add stored_context

Adds a new stored_context method, which may allow for some cleanup
in service.py, and also enable switching from the request context
to the stored context when needed, e.g when the current context
auth_token is about to expire.

Change-Id: I7b797719036238c424905a5d2555dc00e40f4e89
Partial-Bug: #1306294
Restore resource metadata attribute

For backwards compatibility the Resource.metadata attribute
has been restored, however reading or assigning this attribute
will result in a deprecation warning.

Reading metadata will force a refresh from the database, which
maintains the previous behaviour rather than optimising for
performance.

Change-Id: Ifdcf3d98b99a09aac8755c84ef3f59d8602fc6a8
Closes-Bug: #1324704
Allow passing an existing user_creds_id to parser.Stack

Currently we always create a new user_creds entry every time a stack
is stored, even if a user_creds_id is passed to the constructor.  So
allow an existing user_creds ID to be respected.

This will enable optimisation of the creation of trusts, e.g so we won't
have to create a new trust for every nested stack, we can pass the top
level credentials into the nested stack instead, which means updates which
create nested stacks with a trust-scoped-token will work.

This will be required for updates via trusts from Solum, and probably
also to make OS::Heat::AutoScalingGroup work with the trust-alarm-urls
blueprint, where ceilometer will send a signal using a trust.

Change-Id: I7f78a2202514f13deb60ad7d66b9145447cc5625
Partial-Bug: #1317293
blueprint: trust-alarm-urls
Assume compute service_type for nova client

This change removes the ability to specify a non-compute service
type when requesting a nova client. The only non-compute service
type actually requested was the fallback path for cinder. However
nova volumes was completely removed from nova in grizzly, so we
do not need to support this any more.

Change-Id: I9e15f31979d44f018db69ebc8109f707b0f51671
Fix String Parameter Receive a unicode

Add unicode encode to parameter to make sure unicode will be
accepted correctly.

Change-Id: Idc9afad7971eaf0320d719946a3f09b8e15c1479
Closes-Bug: #1330370
Merge "Restore resource metadata attribute"
Merge "Assume compute service_type for nova client"
Unit tests: Always use ResourceDefinition for updates

Change-Id: I85ab9d0a3ed824020c7a38f7a814e7755a437b1a
Unit tests: always use ResourceDefinition for handle_update()

Change-Id: Ib243d6d1f4ff41c83fddcd0a3741cc28ff954448
Unit tests: Name resources the same as in template

We were creating a bunch of resources with a different name from their
definition in the template. This makes the data consistent.

Change-Id: Ibfaaea5077a4a97dc45b84d4d25bbba6a78425bf
Use ResourceDefinition to generate Properties

Change-Id: I30e9b38f79bbcf5532ca35724ef4af8131c06c3c
Unit tests: use ResourceDefinition to test facades

Change-Id: Ied4b3df4e15d165100eb5b059ac605879c6b9b5e
Use ResourceDefinition to generate UpdatePolicy

Change-Id: I08cedd0fb9c7b804a4bf9dd5233f7b9060337a71