Add IP address to error message of failed stack

The error message that occurs when the heat-script.sh or cfn-userdata
script runs doesn't include the IP address of the server, and it's not
possible to find that info in the stack-show output of a failed stack.
Add the IP address to the error message so it is displayed in the
stack-show output to aid in debugging.

Change-Id: I35bd4fbc1a05fa8207f3eb4f501f5becf78415c9
Ensure that the NoCloud data source is loaded, part 2

The cloud-init config is now in /etc/cloud/cloud.cfg.d/90_dpkg.cfg
instead of /etc/cloud/cloud.cfg.d/10_rackspace.cfg, and that caused bug
1285891 to resurface.

Change all files in /etc/cloud/cloud.cfg.d to make this somewhat
future-proof.

Change-Id: I65e2c0795952a5807783bf272061550a4a3447e0
Closes-Bug: #1288920
Closes-Bug: #1285891
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
Add events for automation statuses to Cloud Server

Previously, it was difficult to know if the server was stuck in
CREATE_IN_PROGRESS or if it was waiting for another automation to
complete.

Change-Id: I988a12fc520629a78d8215d4a9c529729a302741
Remove auth_token condition in clients

* Removed useless auth_token condition in clients
since we already have a condition in auth_token getter that returns
"self.context.auth_token or keystone().auth_token", keystoneclient
will raise an "AuthorizationFailure: A username and password or token
 is required" and the error message of the condition won't be shown.
* Added unit tests with no auth_token and with heat client cached

Closes-Bug: #1293806
Change-Id: Ic9ad0e60c09be1ac923f7ef8b669733d7e9c896e
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
Fix heading markup in hot_spec.rst

The Resource Dependencies section in hot_spec.rst used a wrong
heading markup (inconsistent with previous sections' 2nd level
markups), so the heading did not appear in the HTML.

This patch fixes the markup.

Change-Id: Id10ca0246942b2b64ea6269413243379c3ae2158
Closes-Bug: #1295538
Display container ip not gateway IP

As described in the attribute schema of network_ip we want to show the
container ip and not the gateway ip.

Change-Id: I86a3c3476d04d437d7b6bb270d3178d0bc7e8136
Partial-Bug: #1296745
Add docker network_gateway attribute

We previously had it in network_ip attribute when that value should have
been the container ip. Add a new value called network_gateway giving
this information to the user.

Change-Id: I8ebfc576f4bbc470aa2d405e8b063932017904cc
Closes-Bug: 1296745
Raise and catch a specific error during validation

This changes stack creation to return an error message instead of an
exception when (some) validation fails. It doesn't convert all validation
errors to keep the patch at a reasonable size.

Change-Id: I6364bccacbc1d447a99ea61565c96fcc90bd21f9
Partial-Bug: #1276623
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
Update heat.conf.sample

A new version of python-keystoneclient has been released, with changes in
the options for the token auth middleware.

Change-Id: I04a725fac6dea8732533270828ad04f008142ab6
Fix using attributes in unittest

Resource generic_rsrc.ResourceWithComplexAttributes does not have needed
attributes in attribute schema and should be replaced on
generic_rsrc.ResWithComplexPropsAndAttrs.

Change-Id: I5ac60e95fe88bb7a2b9f4a2b612e55561afccd0d
Closes-Bug: #1298204
Order imports in alphabetical order (8/9)

This patch is one in a series to re-enable H306 style check rule
(imports are in alphabetical order).
It touches second half of tests (starting from test_n*).

Implements: blueprint reduce-flake8-ignored-rules (partial)
Change-Id: I5561d90a67eb5dc882200d432fda6b162011ac41
Fail if non-existent security group referenced

When using AWS::EC2::SecurityGroup resources with nova-network (not
Neutron), if a SourceSecurityGroupName was specified in a rule but the
name did not correspond to an extant security group it would be silently
ignored. This change ensures that any such error in the template will cause
creation of the security group to fail.

Closes-bug: #1291091

Change-Id: I9344451c83f4184ef46d4e9906b94abda08836df
Merge "Fix heading markup in hot_spec.rst"
Merge "Fix using attributes in unittest"
Merge "Fail if non-existent security group referenced"
Migrate invalid template version values

If a stack was created with a template that specified an invalid time,
a variety of operations cannot be done on the stack, resulting in a
general breakage of Heat.  This patch migrates any occurances of version
numbers that are invalid that were specified prior to the merging of this
patch.  This patch also handles invalid version fields where a non-date
is specified or an invalid date was specified.

Change-Id: I5387ffb84dba5160103b3cb02f3d1cc5f352ff29
Closes-bug: 1296859
OS::Nova::Server depend on subnets related to nets

Nova supports creating network interfaces by network ID however
if the network and the subnet are part of the same stack as this
server then a race occurs between the creation of the subnet and
the creation of the server. Likewise for delete the subnet cannot
be deleted until all ports are removed from it.

This change adds the same add_dependencies workaround to
OS::Nova::Server that OS::Neutron::Port and OS::Neutron::RouterGateway
have.

The confirmation that this change fixes the race will be confirmed
by tempest test NeutronResourcesTestJSON once
https://review.openstack.org/#/c/82393/ lands.

Change-Id: I626b976446cda709d96823c9de331eafc29d3c68
Closes-Bug: #1243992