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 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
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
Merge "Allow for stack users in _authorize_stack_user"
Merge "Remove use of py3kcompat"