Fix some trivial py3 errors

Change-Id: I72334d2ca82057e591dca4fcfa9ef7ecdd3b6878
Remove unused common.base module

Base module is already replaced with a module from oslo common code,
but was not removed. This patch must fix this.

Change-Id: I8f5c4da8884db4024d47ca8d1a80dbb648922a31
Use assertRaises instead of try/except/else

Change-Id: I8b1105404511c003e032f03777ce85325abbe0cd
Update variable name in test_shell.py

Some variable names cannot reflect its real meaning in unit
test for heat shell, this patch update the variable names to
be more accurate.

Change-Id: Ib9b4770769a20b5e139620ceab0f463a4e035d66
Move template_format from heat to heatclient

heatclient needs to (YAML) parse the template to allow it to populate
the content for get_files function calls. For this reason, template_format
(and environment_format) have been moved to heatclient so this code can be
shared by both heat and heatclient.

Change-Id: I3cc11cd57256ad539efb4dab314ac07547e9e6a2
Fetch environment from fields rather than function arg

This is part of a refactoring of the environment code in preperation for
supporting the get_file intrinsic function.

Change-Id: I8bfc0e17822bb2fa66665241e8873cf7cf1ea611
Use template_format.parse for local stack parsing

Previously, API requests contained parsed templates for
json templates, but string content for YAML templates.

This change means that all requests will now contain parsed
templates. A parsed templates is required for get_file
client-side processing.

According to profiling that Clint performed, YAML parsing
could become a significant source of heat server load, so this
change will also mitigate this by pushing out YAML parsing
load to the clients.

This is part of a refactoring in preperation for
supporting the get_file intrinsic function.

Change-Id: Icca0f5e8ad197433872a995419648f841c9f82e0
reconcile prepare_environment_file/url into one funtion

This is part of a refactoring in preperation for
supporting the get_file intrinsic function.

Change-Id: I5c4a16d76fa29f7be2e4db737ebec49fdc1644e4
Move environment and template file functions to own module

This is part of a refactoring in preperation for
supporting the get_file intrinsic function.

Change-Id: If6974fc72c47e6a5c6545e65375e75cfd177fb7a
Test coverage of empty environment

Change-Id: Iade321762a0e68605006252204d0dd4c7aac8a39
Improve and unit-test template contents fetching

This includes some important changes in the way template
content is fetched:
* for template_file, the value is converted to a file:// URL and the
  actual fetching is performed with the URL fetching code path.
  As a consequence it is now possible to specify a file path *or*
  a URL for the --template-file command option. This is a change in
  behaviour, and it does make --template-url somewhat redundant.
  This makes the behaviour of --template-file consistent with the
  behaviour of --environment-file.
* for template_url, the content is fetched in heatclient so that
  the server does not need to fetch the template at all. This means
  that in the API request the 'template' field is populated instead
  of 'template_url'. We can consider deprecating 'template_url' from
  the REST API.

Change-Id: Id8de05973381dba7ac052c45dd074071fd3035b2
Copy run_test.sh from heat repo

This allows run_test.sh to run without a working venv, plus all the
other features of heat/run_test.sh

Change-Id: I71d7af8a5442626192c5c8b5dca446a999ff6ede
Fix comparison with singletons

Many places in tests code use assertEqual(AA, None),
the same with True and False and negatives of such comparisons.

As comparison to singletons must use `is` operator, appropriate usage
is assertIs, assertIsNot, assertIsNone, assertIsNotNone

These assertions are provided by the `testtools` package,
so this change is not breaking backward compatibility with Python 2.6

Change-Id: I232136ce49afdb8bf78b42221454540471d12c23
Closes-Bug: #1259023
Add to_dict() method to Resource class

Commit a07b8b0b introduces a regression when running 'heat
resource-show' command because heatclient.v1.resources.Resource class
didn't implement the to_dict() method.

This commit adds unit tests for resource show and list commands. It
also removes the use of MagicMock in these tests because it introduced
a recursion issue (see https://review.openstack.org/#/c/65269/).

Change-Id: I6c4c0e293d2955c67a0240136faa2721ef2e4ffa
Closes-Bug: 1266678
Merge "Add to_dict() method to Resource class"
Merge "Update variable name in test_shell.py"
Merge "Fix some trivial py3 errors"
Sync strutils from oslo

Sync strutils from oslo which fix safe_encode under py3, this gets
heat CLI to not output in bytes.

(there is a bit more to be done for complete py3 support)

84d461 Fix a bug in safe_encode where it returns a bytes object in py3

Change-Id: Ic29c0037bfbc612e954045c95edca68f273c4a1a
Merge "Sync strutils from oslo"
Merge "Remove unused common.base module"