Updated from global requirements

Change-Id: I4577a5e16ab79203999ade8f782d7eb1b535c44d
Disable check_uptodate.sh check in pep8

Running generate_sample.sh currently produces an invalid heat.conf.sample
due to bug #1288586.

This change disables the check_uptodate.sh in the tox pep8 so that the
gate-heat-pep8 job passes while we find a more appropriate solution.

Change-Id: Ib20c4f892df68f7112d969d801a18a1a5bfbd474
Related-Bug: #1288586
Insertion port id in address attribute of server

Dictionary returned by server's attribute addresses does not contain
port id value. Current patch adds field port in this dictionary.

Change-Id: Ie458e67d976af0dd394c3fa4a6d77bce78161bef
Closes-bug: #1285899
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
Always answer empty list if deployments not ready

An empty deployments will cause json decode exception, and once
deployments=[] coming, it will trigger another refresh. Always answer
empty list when deployments not ready will solve above two issues.

Change-Id: Iaee3a3ef25cf9907aaefd941dcb316ecb25a29d6
Closes-Bug: #1298417
Add a default DeletionPolicy for Fn::ResourceFacade

The provider template can't know whether this is explicitly included in the
facade resource's definition, and shouldn't need to.

Closes-bug: #1299202

Change-Id: I01177a84b86b69e221d83d87f3efd9e07e5b9c1f
Resolve data from Resource Facade

Since we are looking directly at the template data for the resource facade,
we need to resolve any intrinsic functions that may be present. (For
example, this would be expected if we ever had more than one level of
provider templates, or if e.g. the DeletionPolicy was passed as parameter
to the main stack).

Closes-bug: #1299204

Change-Id: Iaae2fe7be6618c1dee84f2c90bdc179dc2be67d6
Add a resource_facade intrinsic function to HOT

Add a native version of the function, rather than continue to rely on
Fn::ResourceFacade from the Heat-flavoured-cfn templates.

Closes-bug: #1299205

Change-Id: Iee118aeaa72d59e4d6a27ed487b99e9aba9779cd
Fix Jenkins translation jobs

The jobs heat-propose-translation-update and
heat-upstream-translation-update do not update from
transifex since our po files contain duplicate entries where
obsolete entries duplicate normal entries.

Remove all obsolete entries to fix the jobs.

Change-Id: I2071e3a792d107840449bbfe39e3a540ea1b626f
Closes-Bug: #1299349
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
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
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
Check top-level sections when parsing a template

This patch adds validation to template parsing to detect any sections
that do not comply with allowed sections in a template. In the past,
there have been cases where small typos in section names (e.g.
'output' instead of 'outputs') did not get detected and caused issues
at a later point, i.e. by simply not showing any stack outputs.

The place where the template.validate() call has been added to the
parser code only affects new stacks and rejects invalid templates
with an error message. This does not affect stacks that are already
in the database (I did some tests to check this).

Change-Id: Ifed4207badeb364675c905224ba762a9d8eaedd9
Closes-Bug: #1297761
Merge "Updated from global requirements" into milestone-proposed
Merge "Fix timeout for stack actions" into milestone-proposed
Merge "Check top-level sections when parsing a template" into milestone-proposed
Cherry pick oslo rpc HA fixes

Get 2 commits from oslo-rpc fixing HA failover:

* Ia148baa6e1ec632789ac3621c85173c2c16f3918 (fixed HA failover, Qpid
 part)
* I67923cb024bbd143edc8edccf35b9b400df31eb3 (fixed HA failover, RabbitMQ
 part)

Change-Id: I45f679f3da720a0c28fb552d9f4cfb3d8bd21c20
Closes-Bug: #1261631
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: I464d837c74d8be16e125d7701830d0bcbced75ab
Closes-Bug: #1298450
Ensure outputs are resolved for adopted stacks

The resolution of outputs is only performed for stacks in certain
states, so we need to add ADOPT to the valid list of actions,
as after a stack is ADOPT COMPLETE, it should be possible to resolve
the outputs in the same way as after create.

Change-Id: I52d710e5fb23b21848133b9845b2eba3ce76c4cb
Closes-Bug: #1299173
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.

Change-Id: Id81a53a34b5bb2dfbc9425b91be0d02539fe2456
Closes-Bug: #1269686
Closes-Bug: #1251439