Use region for cinder management uri

Make the cinder client region-aware since Rackspace supports
more that one and needs to know in which region to deploy
volumes.

Closes-Bug: #1268706
Change-Id: Ibf7cf4fbabd1e11f798423b9ad2698e43cd46687
Make endpoint_type configurable

Allow to specify the endpoint type to use. Not everybody will
want to use publicURL, so let's make this configurable.

Closes-Bug: #1191109
Change-Id: I6f59fded9f9b70fd638ff17ed9fd4d7733cefac5
Refactor heat gate testing contrib support

The existing code is running tests twice, one for heat, one for
contrib via adding two commands in tox.

This breaked tox single run. For example:

  tox -e py27 -- heat.tests.test_software_config

Except heat.tests.test_software_config is executed, all test cases in
contrib will be executed also.

The patch added contrib in discover list, which can make sure both
contrib in heat gate testing and does not break single test run.

Change-Id: I014d7b95c64287e1fd04a0ba69fce0de554a9a08
Fix adding heat_stack_user role via v3 API

A regression was introduced via 301a894 because it expects
keystoneclient functionality which is not yet merged/released,
so instead of passing the name to roles.list() we must filter
the results locally to lookup the role ID.

The lack of filtering support is a general issue with the v3
keystoneclient interfaces, so when it's fixed we can remove
this workaround.

Closes-Bug: #1271190
Change-Id: I1b29cc131496e4b19493a8cd8e6d4ed913db0938
Fix error in RS Auto Scale properties schema

The Rackspace Auto Scale resource's server networks property should be a
list of maps, not a map of strings.  The property description states
that the it is "Networks to attach to", so the property must be a list.

Change-Id: I6c53a895a820b934f2df7ead0f5732a636a4399d
Closes-Bug: #1270922
Don't pass empty security groups in port creation

Skip the security_groups argument when the list is empty, as it can
break some neutron extensions not supporting security groups.

Change-Id: I970af48953d91182401f67f2483add51485a6f48
Closes-Bug: #1271112
Don't delete trust on backup stack delete

Since the trust_id is copied from the stack being backed-up, we
don't want to delete the trust when the backup is deleted, or
the actual stack will break when the next deferred auth operation
occurs.

Closes-Bug: #1271968
Change-Id: I2b971fad7e010469cbb8a9c9ed326d89e92f2197
heat_keystoneclient migrate create_ec2_keypair to v3 API

Convert create_ec2_keypair to use the v3/credentials API, which
is the v3-compatible way to manage ec2 keypairs.

NOTE: requires the fix for keystone bug #1259584 (now in keystone
master) or signature validation with these credentials will fail.

Change-Id: I9fbc1611c53cd14177b5c0dfe25a96a3922fd1cc
blueprint: keystone-v3-only
Store credential ID for AccessKey and SignalResponder

These resources create an ec2 keypair, which when managed via the
keystone v3/credentials should be accessed via credential ID not
the access key ID, so store the credential ID for performing any
operations (get/update/delete) on the credential, as it's preferable
to having to do a brute-force lookup by access key (no way to filter
on the access key via v3/credentials)

Change-Id: I5995fb003c998fc2d7f331c6da7430adcab168b2
blueprint: keystone-v3-only
Assign X-Auth-Url header in a separate middleware

authtoken middleware's current purpose is to set X-Auth-Url header to a
value read from heat.conf.

Since this value is not really related to anything the keystone
middleware does and is instead read from a config file, it makes sense
to move it from the authtoken middleware into its own middleware

This change is the first step to grouping all X-Auth-Url related logic
into one single middleware as opposed to have it scattered (or possibly
repeated) in auth_token and auth_password. For example, auth_password
also has some logic around it related to multi-cloud, which can be
extracted and moved to auth_url middleware in a later patch, so that all
handling of X-Auth-Url occurs in one place.

Also, by extracting the X-Auth-Url logic, it allows cloud
providers to remove auth_token or auth_password without side-effects.

Closes-Bug: #1259364
Change-Id: Ieb251c18aa091391a28a90c495b61cf41436f8b9
"version" section should be required in template

"HeatTemplateFormatVersion" as default while a template missing version
section now in heat. But then the server can't parse the template in right
way, not translate hot format to cfn. Some errors raised such as:
  Error : At least one Resources member must be defined.
  but "resources" section has one resource.
  Error: The Parameter (image_id) was not defined in template.
  but "image_id" was defined in "parameter" section.

So if we cannot determine the template version, we should raise an
exception. This patch will check whether version section is in template,
if not we should raise exception.

Change-Id: Idc2ba2b9ae099d4509dfd81914aa9bb8bd3bfefb
Closes-Bug: #1267735
Fix order of arguments in assertEqual (patch 1/2)

Some tests used incorrect order assertEqual(observed, expected).

The correct order expected by testtools is
assertEqual(expected, observed).

This patch includes roughly half of the files touched by these changes
(up to and including test_m* sans contrib code) to ease the review.

Partial-Bug: #1259292

Change-Id: I44bff827c7c50726d48aa649b7685712a233ee62
Update base oslo modules

Updated to oslo commit: 8dee4b6f04523d71d2011243875865ebb1508eb6

Change-Id: Iae7af32022c5527cbf186868723b90bf148bf18c
Update olso gettextutils

This is done seperately as it requires function calls to be changed.
Updated to commit: 8dee4b6f04523d71d2011243875865ebb1508eb6

Change-Id: Ia5613c6e7064dd80580bb6bec35ffd6f991f9aee
Fixed OS::Neutron::Pool creation

Resource OS::Neutron::Pool could not be created when
cookie_name param for session_persistence is not set.

By default params that is not set filled with None
as value and passed to the client. This is incorrent
behaviour in Neutron case. Neutron require that all
fields that is not set should not be passed at all.

So we need to fillter out cookie_name param if it's
value set to None.

Closes-bug: #1270750
Change-Id: Iafb082f69bf1dd7a4f49151f65d5a1b8c69f1337
Merge "Fix adding heat_stack_user role via v3 API"
Merge "Refactor heat gate testing contrib support"
Merge "Use region for cinder management uri"
Added testr-args option support for tox coverage

So we can check coverage for some test cases like:

  tox -e cover -- heat.tests.test_sqlalchemy_api

Change-Id: Icd721fbced34b4f6b9e550d927d8fcc4c6439ff8
Merge "Make endpoint_type configurable"