Fix requirements_style_check on BSD platforms

On Linux, the sort command implicitly ignore non-alphanumeric characters
when sorting.  Since the '>' character has an ASCII value greater than
the '-' character, the following list will be sorted on Linux, but not
on a Mac:

SQLAlchemy>=0.7.8,<=0.9.99
sqlalchemy-migrate>=0.9.1

This makes sort explicitly ignore such characters and will keep the
tests consistent across different environments.

Closes-Bug: #1324945
Change-Id: I559ae4b4c3e2a7d190af9d4b1517dfaf23d114b1
Avoid double-initialisation of Resources

If a __new__ method returns an instance of its own class (including
subclasses), Python automatically calls the __init__ method on the instance
before returning it to the caller. Therefore, explicitly constructing a
subclass inside __new__ and returning it was resulting in __init__ being
called a second time. Instead, call object.__new__(), passing the subclass
that we want to instantiate.

Change-Id: I5f891fd97e4cabc6d4c39c5312a0185649702e75
Unit tests: Create resources with ResourceDefinition

Stop creating Resources with dicts that are snippets of templates, and
instead always use ResourceDefinition objects to create Resources.

Change-Id: I1587f1edf9b04f06bd435857d7c1ea2c1cc26058
Use ResourceDefinition in autoscaling

Compare resources using ResourceDefinition objects (which are both
comparable and hashable, and are independent of any one template format)
instead of passing around snippets of a template.

Change-Id: I3bb8bcd2ff54a699a901aac435a56b537d99e992
Handle HOT when converting Outputs to Attributes

When converting the Outputs of a provider template into Attributes of its
facade resource use the Template object (which translates the template into
a consistent, cfn-like format) instead of the raw template data, so that
HOT also works.

Also fixed an outdated (and therefore now misleading) comment.

Change-Id: Iba44ba56be3e1d756cdc01a2b6f4fba171a02057
Merge "Fix requirements_style_check on BSD platforms"
Merge "Avoid double-initialisation of Resources"
Merge "Unit tests: Create resources with ResourceDefinition"
Merge "Use ResourceDefinition in autoscaling"
Merge "Handle HOT when converting Outputs to Attributes"