Shorten physical resource name to custom limit

The default limit for resources is 255, which is
determined by the column size of the name columns in
other openstack project databases.

The limit for nova servers is 53 characters due to typical default
linux HOST_NAME_MAX of 64, minus the '.novalocal' appended to the name.

The reduced name will consist of the following:
* the first 2 characters of the name
* a hyphen
* the end of the name, truncated on the left to bring
  the name length within the limit

The validation fix from bug: #1238272 has been removed.
Closes-Bug: #1250291

(cherry picked from commit 574f3ea54b1299f7f827bf0f6a88a83bccf9c3af)

Conflicts:
	heat/engine/resources/server.py

Change-Id: Iccaf905b2e73433a671559c49223c2b635402853
Merge "Shorten physical resource name to custom limit" into stable/havana
Make LoadBalancer nested stack template configurable

Reviving work originally posted by Angus Salkeld under
https://review.openstack.org/#/c/21405/

This is to enable the various distros to easily override the
hard-coded default nested template (which currently only supports
Fedora 17) with a template approporate to their distro, and
enables deployers to specify their own template (although the
latter use-case will probably be catered for via a provider
template implementation long-term).

Conflicts:
	heat/engine/resources/loadbalancer.py

Partial-Bug: #1234375
Co-Authored-By: Angus Salkeld <angus@salkeld.id.au>
(cherry picked from commit 746a0ed4ad2273d0e67b896efbb6d7a69f9f4c77)
Change-Id: I0a4eccb23b2eebbf31b7aabf0fe85ab31f0ca971
Tolerate lookup failures in Fn::Select

A wait condition will return an empty dict for its Data attribute
until it has been created, however Fn::Select on Data will be evaluated
before the wait condition is created (for example, during stack-list
or stack-show). The current error raising of Fn::Select leads these
operations to fail.

This change results in Fn::Select evaluation behaving in the
following way:
- KeyError on dict lookup failure results in empty string
- IndexError on list index results in empty string
- Passing an empty string as the value results in an empty string

Closes-Bug: #1243958
Change-Id: I3b01c8ce5dc56e804016274282d2ee69f539bf40
Allow DependsOn to accept a list

http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-dependson.html

Change-Id: I8187d8a0395cc96d9727aa812d57f281e69c516d
Closes-bug: #1235496
Use "python -m coverage" instead of coverage cli

As requested by the Debian package maintainer, this makes the
coverage report work more easily on Debian/Ubuntu

Change-Id: Ibed9e164c89543b679393ee18ccdb4a15bdea6d7
Closes-Bug: #1241330
Validate template parameter attributes

Validate that template parameter is provided with at least one attribute.

Closes-Bug: #1227061

Change-Id: I5e245556c21a1ea800eb9e0346f3b2414ad56183
Do not attempt a stack update when it is suspended

And in any state (inprogress, complete, failed).

Closes-bug: #1234242
Change-Id: Ic0bccfa3d3d98cb41d0f5228d8cdc164c5c1fd32
Improve coverage of storing credentials in parser.Stack

Currently the trusts path is not directly tested, so add coverage
and ensure the correct credentials are stored in each case.

Related-Bug: #1247200
Conflicts:
	heat/tests/test_parser.py

(cherry picked from commit 5397e94292dcbf61778bdaf8abdd3c14be728458)
Change-Id: I0aa999e01015046946f242a9b52b484522dc6d72
Add coverage for trusts parser.Stack delete path

Related-Bug: #1247200
(cherry picked from commit 9904be6febc4acd39fb86afe119aa6427e890b9a)
Change-Id: Ic55030be389ac71ec999e08533fa9d5fc05b5bd1
Catch error deleting trust on stack delete

When deleting a stack, it's possible for deleting the trust to fail,
for example if the user deleting the stack is not the user who created
it, or an admin (which raises a Forbidden error), or due to some
other transient error e.g connection to keystone interrupted.

Currently in this case, we fail to mark the stack deleted in the DB
and leave the status "DELETE, COMPLETE", which is misleading.

Conflicts:
	heat/tests/test_parser.py

Closes-Bug: #1247200
(cherry picked from commit 214ba503757e5bd9bf5a5fab6692c4e94d0536fa)
Change-Id: Ie8e9ea48bc4f44e56ff4764123fcca733f5bd458
Don't raise MySQL 2013 'Lost connection' errors

cherry pick, including original commit message below from
oslo-incubator commit:

b4f72b2987d53bb434e3a833f06d70a2167f5efc

Closes bug: 1275838

Although this code error is part of the `ping_listener` tests, it was
missing from the list of known - and ignored - connection errors.

The code error 2013 refers to a connection lost during a query, see:
https://dev.mysql.com/doc/refman/5.0/en/error-messages-client.html#error_cr_server_lost

Without this error code, the session won't try to reconnect to mysql,
which makes `max_retries` useless.

(cherry picked from commit 472c1440677440e0888570926b49542ddf260724)

Conflicts:
	heat/openstack/common/db/sqlalchemy/session.py

Change-Id: Id8a1c0665468b503b092c4f01ffd40e2be9c6fa9
Bump stable/havana next version to 2013.2.3

Change-Id: Ia5b940faf01df6cae58df1f4b4f5e8fa2f3f078a
Fix incompatibilities in tests with keystoneclient 0.6

The patch removes usage of StubOutClassWithMocks with keystone Client
class, which doesn't work anymore now that there is an ABC in the MRO.

Closes-Bug: #1279907
(cherry picked from commit 26fe7a961f644e1c93a92c8a73b25d649137f7b9)

Conflicts:
	heat/tests/test_heatclient.py

Change-Id: I4e8ff2cde2723060faf9906ecf51b13911ac5f42
Merge "Bump stable/havana next version to 2013.2.3" into stable/havana
Merge "Don't raise MySQL 2013 'Lost connection' errors" into stable/havana
Fix "members" property check

According to https://bugs.launchpad.net/heat/+bug/1247638/comments/3

Closes-Bug: #1248571
Closes-Bug: #1247638
Change-Id: I4a61963d730250d8c3714b20c9cc7bb3717d85af
Raise the default max header to accommodate large tokens

PKI tokens hit the default limit if there is enough
services defined in the keystone catalog.

Also the v3 catalog is larger than the v2 catalog which would explain
why this bug is being hit just now.

This change adds the configuration option max_header_line to each of the
API confurations which has a default of 16384.

Closes-Bug: #1190149
Change-Id: I5da09aa08a1242c5e356bd8bf532baa9347ce075
(cherry picked from commit 0b02feb20d4485d0c6d486c5a72b814ce3bdf9e5)
Merge "Fix "members" property check" into stable/havana
Use WithScenarios base class instead of load_tests

To support test scenarios, we now override load_tests in the module
using them. To support alternate test runners and not needing that, the
patch makes the Heat test base class inherit testsceanios.WithScenarios.

Change-Id: Ie2435e41c466c0687bb1dd95080dcac7c837aaba

Conflicts:
	heat/tests/common.py
	heat/tests/test_engine_service.py
	heat/tests/test_environment_format.py
	heat/tests/test_parser.py
	heat/tests/test_random_string.py
	heat/tests/test_template_format.py