Only show progress bar for local image files

This patch fixes a bug where both 'location' and 'progress' are passed
as command line arguments.  In this case, the 'data' field is not
present in the fields dict and therefore the progress option cannot be
used.  A check is added to make sure the user has specified both a local
image file and the progress flag together.

Change-Id: Ia563139ee8b56d54d480534986e4b619a503fbfc
Closes-Bug: #1259357
Update my mailmap

Using new email address.

Change-Id: I4df8536d848fee91ced6debcd259a6cf8f748b44
Fix misspellings in python-glanceclient

Fix misspellings detected by:
* pip install misspellings
* git ls-files | grep -v locale | misspellings -f -

Change-Id: I504521e702c675640ab3869c608fa96edd2477b4
Closes-Bug: #1257295
Merge "Update my mailmap"
Remove tox locale overrides

* tox.ini: The LANG, LANGUAGE and LC_ALL environment overrides were
introduced originally during the testr migration in an attempt to be
conservative about the possibility that locale settings in the
calling environment could cause consistency problems for test runs.
In actuality, this should be unnecessary and any place where it does
cause issues ought to be considered an actual bug. Also, having
these in the configuration actively causes older pip to have
problems with non-ASCII content in some package metadata files under
Python 3, so drop it now.

Change-Id: I6be8e42167191096b16d0f16e8c89e85aeedd74c
Closes-Bug: #1277495
Replace file with open, which is Python 3 compatible

Change-Id: I471ae9b372f88a508d4654b1a18c6da90397a828
Pass bytes to tempfile.NamedTemporaryFile().write()

This method takes bytes as input; the current code fails in Python 3.

Closes-Bug: #1281372
Change-Id: I070d9e9e07523c124f3168b55048fb9d1b338f69
Python 3: Fix JsonPatch-related issues

In Python 3, the generated JSON patches have a different representation than
those generated with Python 2. For instance, the patch generated in
test_patch_should_replace_missing_core_properties() is:

    '[{"op": "replace", "value": "red", "path": "/color"}]'

in Python 2, but:

    '[{"path": "/color", "value": "red", "op": "replace"}]'

in Python 3. Therefore, the comparison fails, and the test fail. We fix the
tests by comparing JsonPatch objects rather than strings.

Closes-Bug: #1281374
Change-Id: Id435e87664b2d2aa0ba69f2df1c1fad431651963
test_shell: remove a deprecated keyword argument

The 'version' keyword argument of argparse.ArgumentParser is deprecated. It was
set to 'None' anyway, so just remove it.

Closes-Bug: #1281856
Change-Id: I6e5af0d90e9b1e7a6a60d5183c13299101148442
Python3: define a __next__() method for VerboseIteratorWrapper

In Python 3, __next__() has replaced next(). Also, call the next() function
rather than the next() method.

Closes-Bug: #1281866
Change-Id: I92b44508c9c875f16ad89ef8410d2c38092ab23d
Fix the parameter order of assertEqual in glanceclient test

On assertEqual, the order of parameters should be (expected, observed).
But, some part of glanceclient test were written with invalid order.
This patch fixes this problem.

Change-Id: I7722fdce766ce3cc5bc9944dc72d7d0af0b09f69
Partially-bug: #1277104
Merge "Python3: define a __next__() method for VerboseIteratorWrapper"
Merge "Python 3: Fix JsonPatch-related issues"
Improve help strings

Make help strings consistent to use "." at end of string.

Fix capitalization of API in one help string.

Change-Id: I7cc5289d881c5e58aad9c69b4668584cdeb0b376
Fix the parameter order of assertEqual in glanceclient v2 test

On assertEqual, the order of parameters should be (expected, observed).
But, some part of glanceclient v2 test were written with invalid order.
This patch fixes this problem.

Partially Close-bug: #1277104

Change-Id: Iae3fb9dda28b67a07f527b15ca83d9cca3e867d4
Merge "Only show progress bar for local image files"
Python 3: do not use the unicode() function

It is Python2-specific, and should not be used in code intended to be portable.

Change-Id: Ibebef1a7e51a7444538275d22d444c926b8b4dec
Closes-Bug: 1284677
Merge "Replace file with open, which is Python 3 compatible"
Merge "Python 3: do not use the unicode() function"
Python3: do not use the 'file' type

It does not exist in Python 3, so we have to use a workaround.

Change-Id: Ib41b5d12102707004b354835265861710aaba568
Closes-Bug: 1287728