Sort requirement files in alphabetical order

This makes code more readable, and can check whether specific library
in the requirement files easily. We also enforce the check in pep8.

Change-Id: I08434dd56d41a82045e4119e547b7b3f60d66698
Closes-Bug: #1285478
Pass bytes to NamedTemporaryFile.write()

In Python 3, this function takes bytes as an input.

Change-Id: I45faa50c4796605885489c9003a1b23b0f0b3080
Modify stack ID lookup to only use stacks:lookup

Currently when we lookup a stack ID (fully qualified name/id) via
stacks:lookup, we also follow the redirect to stacks:show, which
is not allowed for stack users.  We don't actually need to follow
the redirect, as we already have the required ID, so instead we
return the redirect response, so we can just allow all users to
do stacks:lookup in the policy.

This is useful for clients who want to call API actions which are
allowed for stack users, e.g resource:signal without having to know
both the name and ID of the stack.

Change-Id: I6f079cbc7ac3c680f15941668b4efbe4c3c5d60d
Partial-Bug: #1291097
Add new tests to cover most of the requests port

After the merge to requests there was a few tests to be added to
properly cover the port and now reach 97% for coverage of
heatclient/common/http.

Change-Id: I8282459718968337f1bcd650d540509c418020c5
Oslo: sync strutils

The strutils module has been improved with regards to Python 3
compatibility.  For instance, safe_{encode,decode} may now take bytes
as input, which is needed to completely port heatclient to Python 3.

This module is now in sync with commit
c1f1a6d87d3f8a5420f5e749ae5ed85e15ff5fe4.

Change-Id: I658467dc85038da029e0ae8b40fc027cdc4d5eaf
Python 3: Fix YamlEnvironmentTest tests

In Python 3, this happens:

>>> 'foo' in ValueError('foo')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: argument of type 'ValueError' is not iterable

We have to cast the Exception to make the tests work.

Change-Id: Ifc06c9860412030dc697b264812a6bf78e10eb8b
Remove dependent module py3kcompat

Module py3kcompat was removed from oslo-incubator, we can use
six directly.

* Sync commit of removing py3kcompat from oslo
* use six replace usage of py3kcompat

Change-Id: If0f9397588b2180fe198e804cbbb5b5c8420fe76
Closes-Bug: #1280033
Workaround failing pypy gate job

Until a proper fix is found, pin the version of setuptools to one
that doesn't cause this issue.

Change-Id: I4f5f2b6449a90df06b366f9eb3f2c16bb37cc758
Related-Bug: #1290562
Add stack-preview support

Co-Authored-By: Richard Lee <rblee88@gmail.com>
Change-Id: I4d7b12f6da09411d45dd6022dc11b8ece76b4932
Implements: blueprint preview-stack
Output warnings for deprecated commands

There are various options which have been deprecated for a long
time but with no user-visble indication of the deprecated status.
So log a warning to encourage the user to switch to the new
interfaces instead of just having a strongly-worded docstring ;)

Hopefully this means we can, at some future point, justifiably
remove the duplicate deprecated functions.

Change-Id: Ia5d791de99e7238645beb7d7650d811225d9d9c6
Merge "Oslo: sync strutils"
Merge "Add stack-preview support"
Merge "Modify stack ID lookup to only use stacks:lookup"
Merge "Remove dependent module py3kcompat"
Merge "Add new tests to cover most of the requests port"
Merge "Pass bytes to NamedTemporaryFile.write()"
Using common methods from oslo cliutils

Synchronize the cliutils from oslo to heatclient and use
the common methods.

used common methods:
+arg
+env
+print_list

partially implements blueprint common-client-library-2

Change-Id: If79d58794257325a47b9938a172a87097fc93e1b
Merge "Python 3: Fix YamlEnvironmentTest tests"
Merge "Using common methods from oslo cliutils"
Merge "Sort requirement files in alphabetical order"