Isolate test from environment variables

One test ('test_get_client_all_creds') will fail if any of the typical
Openstack environment variables have been set (eg OS_PASSWORD).

Change-Id: I982f526168be7a5a07b5cd48af522f7f9bc74f2e
Closes-bug: #1376247
Handle some exceptions of image_create v2 api

Currently, in image_create v2 api source we can see
ReservedProperty, ReadonlyProperty and TypeError caused in
glance/domain/__init__.py are not handled, which will cause
500 when these exceptions happens.The internal error should
be interpreted to the appropriate exception to the user.
This patch catches them and changes them to http exception.

Change-Id: I0c82a142b3357c8b8faab7dc0905967983cb8f7c
Remove openstack.common.test

This module is not used.

Change-Id: I62787aa68474db6e049c92dc1b65ba87f2453474
Separate glance and eventlet wsgi logging

The log output from both glance.common.wsgi and
eventlet.wsgi have the same prefix:

glance.wsgi.server [-] Started child 3679
glance.wsgi.server [-] (3679) wsgi starting up on http://0.0.0.0:80/

It's better to have them separated, eg:

glance.common.wsgi [-] Started child 3729
eventlet.wsgi.server [-] (3729) wsgi starting up on http://0.0.0.0:80/

(This matches, for example, the Cinder behaviour.)

Change-Id: Ic42a2966e63270a6a9fed4eeb3b7737ca25b8c1d
Closes-bug: #1382585
Update the vmware_disktype metadefs values

Update the vmware_disktype metadef value to reflect what nova
supports.

Change-Id: I34ce200968f4cb6dfd209150de4615b25787bb7a
Use unicode for error message

Prior to this change, glance-reg would encounter an error, then
encounter an error reporting the first error. Glance-reg would end up
dead with the only error message printed being about the fact that the
first error message wasn't unicode.

After this change, glance-reg still dies just as readily - but on the
way down, it manages to emit the original error message. In my case,
this means that I now know that the original fault is that it can't bind
to 0.0.0.0:9191

Change-Id: I0e90b538996f87fe100c973fdf1fb61791e4e660
closes-bug: 1383255
Make RequestContext use auth_token (not auth_tok)

The RequestContext class from oslo-incubator uses 'auth_token'.
Glance's RequestContext uses 'auth_tok' -- which is inconsistent.

glance_store currently uses the oslo 'auth_token'.

We should not assume a 1-1 mapping from the glance_store to glance,
nor should we have glance_store support both 'auth_token' and
'auth_tok'. Therefore Glance should be updated to use 'auth_token'.

This change was generated automatically with:

$ for file in `find glance -name '*\.py' -exec grep -wl auth_tok "{}" \;` ; \
  do sed --in-place 's/\<auth_tok\>/auth_token/g' $file ; done

In addition, the set_auth_token function was removed. This had been used
by Nova to work around the auth_tok <-> auth_token inconsistency, but
was removed in mid-2012 as part of the move to python-glanceclient so
is no longer needed.

In conjuction with other changes this fixes image upload when
using the multi-tenant Swift store.

Change-Id: Ic8a5f44088990fd8f6290a5622b823f59ef365fc
Partial-bug: #1385213
vim ropeproject directories added to gitignore

Change-Id: I9270098ed618672233441e0bcb3693917060d872
Replace custom lazy loading by stevedore

Now we have own implementation for loading
extensions. stevedore avoids creating yet
another extension mechanism by building on
top of setuptools entry points.

Change-Id: I7fcb981b58b20fb49d10eea3d477f962e4bf3565
Merge "Make RequestContext use auth_token (not auth_tok)"
Merge "Replace custom lazy loading by stevedore"
Typo correction of the prefix value in compute-host-capabilities

Simple typo correction.

Change-Id: I6f37a992e4841400be8d71050796b7c526d29864
Closes-Bug: #1390031
Remove exception declarations from replicator.py

Exception declarations should be stored in
glance/common/exception.py.

This patch transfers UploadException there and replaces other
duplicate exceptions with standard counterparts from webob.

Change-Id: Ifbb2c22c4360067e22af37b4439ff5eff93e4073
Upgrade tests' mocks to match glance_store

Latest glanec_store release added a new `context` keyword to some
functions. This broke backwards compatibility for some of the tests in
master and juno.

This change adds the corresponding keyword to the mock calls.

Closes-bug: #1391437

Change-Id: I5e58462e4c076b3ea56e27361eb6c3b0aafa2493
Merge "Remove exception declarations from replicator.py"
Removal of unnecessary sample file from repository

Sample file (etc/logging.cnf.sample) is not needed anymore,
since we use openstack common logging now. So, I am removing this file from
Glance repository.

Closes-Bug: #1163075

Change-Id: I7b769998983f34840d525bd3ead4dc38e03f4602
Merge "Use unicode for error message"
Wrong order of assertEquals args(Glance)

Args of assertEquals method in glance.tests are arranged
in wrong order. In result when test fails it shows incorrect
information about observed and actual data. It's found more
than 2000 times. Right order of arguments is "expected, actual".

Change-Id: Ifea4809f5a696b608a19e36a9ed9e5eec46c8a21
Co-Authored-By: Li Yingjun <liyingjun1988@gmail.com>
Closes-Bug: 1277104
Merge "Remove openstack.common.test"
metadef modules should only use - from wsme.rest import json

Several metadef module routines use:
from wsme.rest.json import fromjson
from wsme.rest.json import tojson

To follow the import rules at http://docs.openstack.org/developer/hacking/
(only import modules), these should be replaced with:
from wsme.rest import json

Change-Id: Idc496c8753d93a3d39f0c9cbbb31205948eeb081
Closes-bug: 1392485