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
Add more unit tests for ThreadGroupManager

this patch adds unit tests for the rest of ThreadGroupManager methods.
Related-Bug: #1288627
Change-Id: I38a0864c649d1693ef4fb5b49d5aeb37632263ca
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
Refactor CLB to work with groups

The Rackspace CLB resource couldn't be used with resource groups
because nodes were individual IPs or references. This change
allows a node to have a list of ips for a given port, status,
etc so that references to resource groups can easily be added
to Rackspace CLB instances. Ref-based nodes were removed as they
aren't used.

Change-Id: Ia26a012758fb1cd0470c1c0edc27e61e77bd8f0a
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
Get rid of global variable in JSON->YAML conversion

The best way to deal with the lack of proper closures in Python 2 (Python
3 has the nonlocal keyword to handle this) is to wrap the object in a list
and manipulate the first list element instead. In this case, though, even
that is not necessary.

Change-Id: Iac6d95a66b1bfc6fd409851bf6c918629a98335f
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
Add documentation to the firewall properties

miss documentation for the firewall properties,add it.

ref:
  http://docs.openstack.org/api/openstack-network/2.0/content/fwaas_ext_ops_firewall.html

Change-Id: I7bca7d29b05133d11ed53dede0caa561e792fa09
Fix user provider template registration

Trying to use an external template as a resource fails in obscure path
in the environment because TemplateResourceInfo value is not required.
Enforcing a value (with the template path) fixes the issue.

Change-Id: Ib92bc0827e9a94a3735493eb47cd227449552990
Closes-Bug: #1288541
Don't re-bind parameters during stack update

While we're in the process of updating a stack, we set the stack's parameters
to the new, updated values. However, we don't want to change existing
resources' idea of their own values until we have explicitly done an update of
them to bring them into line with the new template/parameters. So when parsing
a template snippet, store the parameters object to which it will refer.
References will resolve to the new parameters only when the template has been
re-resolved.

Closes-bug: #1291411

Change-Id: Iebbb518c5d15cfba858db001648f3412a7d8b1c0
Stack identity reads tenant from stack not context

This refactors the way stack identity reads tenant_id information so
that it uses the information already in the stack, instead of getting it
from the context every time.

This allows for unscoped list of stacks to show correct project
information (the project that each stack belongs to), instead of the
current one in the context.

Co-Authored-By: Richard Lee <rblee88@gmail.com>
Closes-Bug: 1294385
Change-Id: I976e7f7dea4432b97a2b97382bf05eb3bd1ca565
Using resolving properties for update

For definition reference in template we should use built-in functions.
So template after parsing with resolve_static_data will contain
references on these functions instead resolve values.
If we want get some information about previous state of stack during
update, we should use self.properties instead of self.t['Properties'].
Also default=[] was added to avoid error when we try to do set([]).

Closes-bug: #1292495
Change-Id: I0cc44a0a541913cca665caec1a7f3a2a1a6cebc9
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
Merge "Stack identity reads tenant from stack not context"
Merge "Using resolving properties for update"
Implement an identifier stack_path()

This returns stack_name/stack_id, which is the form that needs to be
used with heatclient to avoid doing an extra stack lookup API call.

See the next change in this series to see this in use.

Change-Id: I41dcb732d36d702b7583b5e877fd074f86445a03
Related-Bug: #1291097
Provide the necessary inputs to enable HEAT_SIGNAL

To allow signalling via a native heatclient call using stack domain credentials
the following inputs are needed:
- the user ID, required to successfully auth with stack domain users, since it avoids
the need to have knowledge of the domain ID.
- the V3 endpoint as the auth_url, since it is domain aware
- a stack ID which consists of stack_name/stack_id, to avoid the need for an extra
  stack identifier lookup

Closes-Bug: #1291097
Change-Id: I677d1afb9bc40f84d9a71f376869946022a6635f
Merge "Get rid of global variable in JSON->YAML conversion"