Make ROOTDIR determination more robust

Remove unused CLIENTDIR and replace it with a TESTDIR
(pointing to rootdir/keystoneclient/tests) and use
normpath for determining the full path of rootdir.

This change is needed if keystoneclient/ is a symlink
and etc/ is in a different directory hierarchy.

Change-Id: Ice9165ef25ec0200ccfb50c2f2f3121a136652a2
Apply six for metaclass

The way to using metaclass has changed in Python3.

Python 2.7 way:

class Foo(object):
  __metaclass__ = FooMeta

Python 3 way:

class Foo(object, metaclass=FooMeta):
  ...

The six.add_metaclass() decorator allows us to use one syntax that
works for both Python 2.7 and Python 3.

Change-Id: I08703a8b2927f45f4705fe085368d1ebd78b02fa
Closes-Bug: #1236648
Avoid returning stale token via auth_token property

The auth_ref token should take precedence over the user provided
token, since any call to authenticate() will update the auth_ref,
rendering the auth_token_from_user stale.

Change-Id: Ibc86dca840f4b8dd23856735616ee48a7b397fcd
Closes-Bug: #1244675
python3: Work around httpretty issue

Currently running tox.ini with py33 installation
fails because of a failure to read a unicode file
while installing httpretty.

Closes-Bug: #1241560

Change-Id: I6012c4fcca0d0354f0c1bdf4797f6e7409f7bf1c
Signed-off-by: Chuck Short <chuck.short@canonical.com>
PEP 8 Public and internal interfaces

Define which interfaces are public and which are internal based
on PEP 8.

For reference, PEP 8 section is here:
http://www.python.org/dev/peps/pep-0008/#public-and-internal-interfaces

Change-Id: I14233796b7838b78fbd355014478f3e326542966
Merge "Make ROOTDIR determination more robust"
Merge "Apply six for metaclass"
Merge "python3: Work around httpretty issue"
Update the management url for every fetched token

management_url was originally set once and never changed so that when
specifying an endpoint it wasn't later overridden by the service
catalog. This behaviour would prevent the management_url from being
updated when the client was reauthenticated.

Change-Id: I2fa41e2ae1b853bbb254698cf94b9314eb0f0903
Closes-bug: 1252927
Merge "Avoid returning stale token via auth_token property"
Revert "Merge "Avoid returning stale token via auth_token property""

This reverts commit b89d28663ed181e1df56ada271931891a4c77f67, reversing
changes made to 8a0732e262cd9de508399eabeb705b681c2503c0.

This change was causing gate issues. It breaks a few Keystone tests in
test_keystoneclient.py.

Change-Id: I8de6988c554a1359c04ce2d1a8c4707dee7c3782
Merge "Update the management url for every fetched token"