Make the first line of every file consistent.

Change-Id: I2e1a809cfca8e88693551d58d33e747f54ee5eb1
Order imports in alphabetical order (4/9)

This patch is one in a series to re-enable H306 style check rule
(imports are in alphabetical order). It touches db files.

Implements: blueprint reduce-flake8-ignored-rules (partial)
Change-Id: I66842c6a5d112f948e625e18ef6d01afcad61e57
Ensure parameter timeout_mins available in update

The parameter timeout_mins is not available when
updating a stack. The updater gets it from the
old stack no matter whether timeout_mins is
offered or not.

If timeout_mins is not offered in the new stack,
get the timeout from the old stack, and update
this parameter using the new stack's timeout.

Change-Id: I7d04d0f0b7cc917d49d45c0d3e1d5a8ffb7bff0b
Closes-Bug: 1290603
Remove unused code in test_validate.py

Remove the mock of instances.Instance.nova() for some tests.

Change-Id: I48aaaacaa827cd96ad2372011daf48e386e87c01
Run pep8 check in run_tests.sh as in tox

Until now the flake8 tests run by tox and run_tests.sh were a bit
different - run_tests.sh was not checking heat-* python scripts in bin
folder and was checking the docs folder that is ignored in tox' pep8
check.

This patch brings pep8 style checking done by run_tests.sh in line with
what is done by tox (and thus the gate).

Change-Id: Ie3f2c25210075df6b941854737f0d926d141601b
Credentials for native heat os-collect-config polling

For Server software_config_transport=POLL_SERVER_HEAT the os-collect-config
configuration has been changed in the following way:
* included stack_id and resource_name
* replaced username with user_id, since domain users should always be
  referenced by ID.
* renamed the collector key from "heat_server_poll" to "heat" since that
  is the intended name for the heat collector in os-collect-config

Closes-Bug: #1299986

Change-Id: I42326c81c7276d7d305a05c00d72a6102e80abca
Pass and use the environment in validate_template

Use the environment passed in validate_template to be able to validate
template using custom resources.

Change-Id: I85e23f26f5abbafe50073c3ac023933316af05ac
Closes-Bug: #1298450
Remove use of py3kcompat

Replace usage of py3kcompat.urlutils by six imports. py3kcompat has been
removed from oslo incubator so we should try to sync.

Change-Id: I252ff2b3a5284cee6e09e70a79b7dad550335f41
Correct update to zero numbers of health monitors

If property 'monitors' is in prop_diff and equals to None ot [],
we should not skip dissociating step for monitors.

Change-Id: I313a8e09dbeeab78126ff889316f0ecb1a9a8c84
Closes-Bug: #1301406
Merge "Order imports in alphabetical order (4/9)"
Merge "Credentials for native heat os-collect-config polling"
Merge "Remove unused code in test_validate.py"
Merge "Run pep8 check in run_tests.sh as in tox"
Merge "Ensure parameter timeout_mins available in update"
Fix timeout for stack actions

The problem is that the timeout for running any action (i.e. create or update)
on stack is not passed from parent stack to nested stack.
All heat resources which are internally implemented as StackResource are
affected. For example AutoScalingGroup always using default timeout
(60 minutes). If creating any of the instances will take more that it will
fail no matter what timeout you will pass creating stack.

Changes:
* removes hardcoded timeout (60 minutes)
* adds new config option to specify timeout for stack action
* if timeout was not specified for nested stack then timeout from parent
  is used
* adds test for StackResource and parser.Stack

Change-Id: I39494b75774988c625cb22cc7873d628c04d3228
Closes-Bug: 1287719
Allow for stack users in _authorize_stack_user

This change allows stack user credentials to be used to call
describe_stack_resource (heat resource-metadata)

It makes the following changes:
* _authorize_stack_user first attempts authorize with
  stack.access_allowed using the context user_id before falling back
  to looking for ec2 credentials
* context middleware sets the user_id on the context even when the
  username is not specified

This change also adds missing test coverage to ContextMiddleware

Change-Id: Idb655e403ba11a3144dacf34eba0feb59ab8d911
Closes-Bug: #1299982
Add handle_update to VolumeAttachment

Updates for volume attachments were handled in UpdateReplace manner,
which fails when in need to attach new volume to the same mount
(or attach the same volume to different mount on the same server,
or attaching the same volume to different server).

This patch makes all properties of VolumeAttachment
to be update_allowed, adds necessary handle_update logic
and fixes VolumeDetachTask to reliably detach old volume
so that new one can be immediately attached.

Closes-Bug: #1269686
Closes-Bug: #1251439
Change-Id: I0aee64036bf8125f76e7f427716412a326ff5eef
Catch exception during resolving outputs

Previously we got error when try to show incorrect outputs.
Now we catch all exceptions and return None value in this case.

Change-Id: I7a7c53c1ad8f42082c89c92cbcb52599a6c7f1f8
Closes-Bug: #1273490
Merge "Allow for stack users in _authorize_stack_user"
Merge "Remove use of py3kcompat"