summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Basnight <mbasnight@gmail.com>2013-06-17 23:34:27 -0700
committerMichael Basnight <mbasnight@gmail.com>2013-06-21 20:15:23 +0000
commit9916c8f2733b683d859770d05dacd2c9c82912d7 (patch)
tree084a0d53580cbbd34ed8f28de9302d6c78f7050d
parentbc90b3e088d3d4b83b5b3de0f9f83d9b6956947d (diff)
downloadpython-troveclient-9916c8f2733b683d859770d05dacd2c9c82912d7.tar.gz
Rename from reddwarf to trove.0.1.3
Implements Blueprint reddwarf-trove-rename Change-Id: Ib2d694c7466887ca297bea4250eca17cdc06b7bf
-rw-r--r--.testr.conf2
-rw-r--r--README.rst10
-rw-r--r--reddwarfclient/__init__.py31
-rwxr-xr-xrun_local.sh18
-rw-r--r--setup.cfg6
-rw-r--r--test-requirements.txt4
-rw-r--r--troveclient/__init__.py31
-rw-r--r--troveclient/accounts.py (renamed from reddwarfclient/accounts.py)4
-rw-r--r--troveclient/auth.py (renamed from reddwarfclient/auth.py)4
-rw-r--r--troveclient/backups.py (renamed from reddwarfclient/backups.py)2
-rw-r--r--troveclient/base.py (renamed from reddwarfclient/base.py)6
-rw-r--r--troveclient/cli.py (renamed from reddwarfclient/cli.py)8
-rw-r--r--troveclient/client.py (renamed from reddwarfclient/client.py)52
-rw-r--r--troveclient/common.py (renamed from reddwarfclient/common.py)12
-rw-r--r--troveclient/databases.py (renamed from reddwarfclient/databases.py)8
-rw-r--r--troveclient/diagnostics.py (renamed from reddwarfclient/diagnostics.py)2
-rw-r--r--troveclient/exceptions.py (renamed from reddwarfclient/exceptions.py)0
-rw-r--r--troveclient/flavors.py (renamed from reddwarfclient/flavors.py)4
-rw-r--r--troveclient/hosts.py (renamed from reddwarfclient/hosts.py)4
-rw-r--r--troveclient/instances.py (renamed from reddwarfclient/instances.py)8
-rw-r--r--troveclient/limits.py (renamed from reddwarfclient/limits.py)2
-rw-r--r--troveclient/management.py (renamed from reddwarfclient/management.py)10
-rw-r--r--troveclient/mcli.py (renamed from reddwarfclient/mcli.py)8
-rw-r--r--troveclient/quota.py (renamed from reddwarfclient/quota.py)4
-rw-r--r--troveclient/root.py (renamed from reddwarfclient/root.py)6
-rw-r--r--troveclient/security_groups.py (renamed from reddwarfclient/security_groups.py)6
-rw-r--r--troveclient/storage.py (renamed from reddwarfclient/storage.py)2
-rw-r--r--troveclient/tests/__init__.py0
-rw-r--r--troveclient/tests/test_accounts.py (renamed from reddwarfclient/tests/test_accounts.py)4
-rw-r--r--troveclient/tests/test_auth.py (renamed from reddwarfclient/tests/test_auth.py)20
-rw-r--r--troveclient/tests/test_base.py (renamed from reddwarfclient/tests/test_base.py)6
-rw-r--r--troveclient/tests/test_client.py (renamed from reddwarfclient/tests/test_client.py)40
-rw-r--r--troveclient/tests/test_common.py (renamed from reddwarfclient/tests/test_common.py)8
-rw-r--r--troveclient/tests/test_instances.py (renamed from reddwarfclient/tests/test_instances.py)6
-rw-r--r--troveclient/tests/test_limits.py (renamed from reddwarfclient/tests/test_limits.py)2
-rw-r--r--troveclient/tests/test_management.py (renamed from reddwarfclient/tests/test_management.py)6
-rw-r--r--troveclient/tests/test_secgroups.py (renamed from reddwarfclient/tests/test_secgroups.py)6
-rw-r--r--troveclient/tests/test_users.py (renamed from reddwarfclient/tests/test_users.py)4
-rw-r--r--troveclient/tests/test_utils.py (renamed from reddwarfclient/tests/test_utils.py)4
-rw-r--r--troveclient/tests/test_xml.py (renamed from reddwarfclient/tests/test_xml.py)8
-rw-r--r--troveclient/users.py (renamed from reddwarfclient/users.py)12
-rw-r--r--troveclient/utils.py (renamed from reddwarfclient/utils.py)0
-rw-r--r--troveclient/versions.py (renamed from reddwarfclient/versions.py)2
-rw-r--r--troveclient/xml.py (renamed from reddwarfclient/xml.py)6
44 files changed, 193 insertions, 195 deletions
diff --git a/.testr.conf b/.testr.conf
index 8f0b597..d45a93a 100644
--- a/.testr.conf
+++ b/.testr.conf
@@ -2,7 +2,7 @@
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
- ${PYTHON:-python} -m subunit.run discover . $LISTOPT $IDOPTION
+ ${PYTHON:-python} -m subunit.run discover -t ./ ./troveclient/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list
diff --git a/README.rst b/README.rst
index 929143b..2be9bfb 100644
--- a/README.rst
+++ b/README.rst
@@ -1,9 +1,9 @@
-Python bindings to the Reddwarf API
+Python bindings to the Trove API
==================================================
-This is a client for the Reddwarf API. There's a Python API (the
-``reddwarfclient`` module), and a command-line script (``reddwarf``). Each
-implements 100% (or less ;) ) of the Reddwarf API.
+This is a client for the Trove API. There's a Python API (the
+``troveclient`` module), and a command-line script (``trove``). Each
+implements 100% (or less ;) ) of the Trove API.
Command-line API
----------------
@@ -13,7 +13,7 @@ tenant, and appropriate auth url.
.. code-block:: bash
- $ reddwarf-cli --username=jsmith --apikey=abcdefg --tenant=12345 --auth_url=http://reddwarf_auth:35357/v2.0/tokens auth login
+ $ trove-cli --username=jsmith --apikey=abcdefg --tenant=12345 --auth_url=http://trove_auth:35357/v2.0/tokens auth login
At this point you will be authenticated and given a token, which is stored
at ~/.apitoken. From there you can make other calls to the CLI.
diff --git a/reddwarfclient/__init__.py b/reddwarfclient/__init__.py
deleted file mode 100644
index 0383828..0000000
--- a/reddwarfclient/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright (c) 2011 OpenStack, LLC.
-# All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License"); you may
-# not use this file except in compliance with the License. You may obtain
-# a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations
-# under the License.
-
-
-from reddwarfclient.accounts import Accounts
-from reddwarfclient.databases import Databases
-from reddwarfclient.flavors import Flavors
-from reddwarfclient.instances import Instances
-from reddwarfclient.hosts import Hosts
-from reddwarfclient.management import Management
-from reddwarfclient.management import RootHistory
-from reddwarfclient.root import Root
-from reddwarfclient.storage import StorageInfo
-from reddwarfclient.users import Users
-from reddwarfclient.versions import Versions
-from reddwarfclient.diagnostics import DiagnosticsInterrogator
-from reddwarfclient.diagnostics import HwInfoInterrogator
-from reddwarfclient.client import Dbaas
-from reddwarfclient.client import ReddwarfHTTPClient
diff --git a/run_local.sh b/run_local.sh
index f4497bc..d496a68 100755
--- a/run_local.sh
+++ b/run_local.sh
@@ -9,9 +9,9 @@ me=${0##*/}
function print_usage() {
cat >&2 <<EOS
-Run tests against a local instance of reddwarf
+Run tests against a local instance of trove
-Usage: $me reddwarf_path [logfile]
+Usage: $me trove_path [logfile]
EOS
}
@@ -28,25 +28,25 @@ if [ $# -lt 1 ]; then
exit 5
fi
-reddwarf_path=$1
-reddwarf_pid_file="`pwd`.pid"
+trove_path=$1
+trove_pid_file="`pwd`.pid"
function start_server() {
server_log=`pwd`/rdserver.txt
set +e
rm $server_log
set -e
- pushd $reddwarf_path
- bin/start_server.sh --pid-file=$reddwarf_pid_file \
+ pushd $trove_path
+ bin/start_server.sh --pid-file=$trove_pid_file \
--override-logfile=$server_log
popd
}
function stop_server() {
- if [ -f $reddwarf_pid_file ];
+ if [ -f $trove_pid_file ];
then
- pushd $reddwarf_path
- bin/stop_server.sh $reddwarf_pid_file
+ pushd $trove_path
+ bin/stop_server.sh $trove_pid_file
popd
else
echo "The pid file did not exist, so not stopping server."
diff --git a/setup.cfg b/setup.cfg
index 449e000..bc83705 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -19,12 +19,12 @@ classifier =
[entry_points]
console_scripts =
- reddwarf-cli = reddwarfclient.cli:main
- reddwarf-mgmt-cli = reddwarfclient.mcli:main
+ trove-cli = troveclient.cli:main
+ trove-mgmt-cli = troveclient.mcli:main
[files]
packages =
- reddwarfclient
+ troveclient
[global]
setup-hooks =
diff --git a/test-requirements.txt b/test-requirements.txt
index c1b2eb6..f184f40 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -8,7 +8,5 @@ discover
sphinx>=1.1.2
testrepository>=0.0.13
testtools>=0.9.29
-# This used to be but openstack/requirements is set to [below].
-# If this breaks we 1) fix tests to use [below] or
-# 2) petition to use mock>=1.0.1
mock>=0.8.0
+
diff --git a/troveclient/__init__.py b/troveclient/__init__.py
new file mode 100644
index 0000000..e3506af
--- /dev/null
+++ b/troveclient/__init__.py
@@ -0,0 +1,31 @@
+# Copyright (c) 2011 OpenStack, LLC.
+# All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+
+
+from troveclient.accounts import Accounts
+from troveclient.databases import Databases
+from troveclient.flavors import Flavors
+from troveclient.instances import Instances
+from troveclient.hosts import Hosts
+from troveclient.management import Management
+from troveclient.management import RootHistory
+from troveclient.root import Root
+from troveclient.storage import StorageInfo
+from troveclient.users import Users
+from troveclient.versions import Versions
+from troveclient.diagnostics import DiagnosticsInterrogator
+from troveclient.diagnostics import HwInfoInterrogator
+from troveclient.client import Dbaas
+from troveclient.client import TroveHTTPClient
diff --git a/reddwarfclient/accounts.py b/troveclient/accounts.py
index 43e9135..5f60fa7 100644
--- a/reddwarfclient/accounts.py
+++ b/troveclient/accounts.py
@@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
-from reddwarfclient.common import check_for_exceptions
+from troveclient import base
+from troveclient.common import check_for_exceptions
class Account(base.Resource):
diff --git a/reddwarfclient/auth.py b/troveclient/auth.py
index 4494447..909d45b 100644
--- a/reddwarfclient/auth.py
+++ b/troveclient/auth.py
@@ -12,7 +12,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import exceptions
+from troveclient import exceptions
def get_authenticator_cls(cls_or_name):
@@ -228,7 +228,7 @@ class ServiceCatalog(object):
def _url_for(self, attr=None, filter_value=None,
endpoint_type='publicURL'):
"""
- Fetch the public URL from the Reddwarf service for a particular
+ Fetch the public URL from the Trove service for a particular
endpoint attribute. If none given, return the first.
"""
matching_endpoints = []
diff --git a/reddwarfclient/backups.py b/troveclient/backups.py
index c78b840..036f027 100644
--- a/reddwarfclient/backups.py
+++ b/troveclient/backups.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
import exceptions
diff --git a/reddwarfclient/base.py b/troveclient/base.py
index 6660ff4..01cd19d 100644
--- a/reddwarfclient/base.py
+++ b/troveclient/base.py
@@ -22,8 +22,8 @@ Base utilities to build API operation managers and objects on top of.
import contextlib
import hashlib
import os
-from reddwarfclient import exceptions
-from reddwarfclient import utils
+from troveclient import exceptions
+from troveclient import utils
# Python 2.4 compat
@@ -93,7 +93,7 @@ class Manager(utils.HookableMixin):
often enough to keep the cache reasonably up-to-date.
"""
base_dir = utils.env('REDDWARFCLIENT_ID_CACHE_DIR',
- default="~/.reddwarfclient")
+ default="~/.troveclient")
# NOTE(sirp): Keep separate UUID caches for each username + endpoint
# pair
diff --git a/reddwarfclient/cli.py b/troveclient/cli.py
index f83de6d..487a45c 100644
--- a/reddwarfclient/cli.py
+++ b/troveclient/cli.py
@@ -15,7 +15,7 @@
# under the License.
"""
-Reddwarf Command line tool
+Trove Command line tool
"""
#TODO(tim.simpson): optparse is deprecated. Replace with argparse.
@@ -24,17 +24,17 @@ import os
import sys
-# If ../reddwarf/__init__.py exists, add ../ to Python search path, so that
+# If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
-if os.path.exists(os.path.join(possible_topdir, 'reddwarfclient',
+if os.path.exists(os.path.join(possible_topdir, 'troveclient',
'__init__.py')):
sys.path.insert(0, possible_topdir)
-from reddwarfclient import common
+from troveclient import common
class InstanceCommands(common.AuthedCommandsBase):
diff --git a/reddwarfclient/client.py b/troveclient/client.py
index f602afb..1409448 100644
--- a/reddwarfclient/client.py
+++ b/troveclient/client.py
@@ -30,8 +30,8 @@ if not hasattr(urlparse, 'parse_qsl'):
import cgi
urlparse.parse_qsl = cgi.parse_qsl
-from reddwarfclient import auth
-from reddwarfclient import exceptions
+from troveclient import auth
+from troveclient import exceptions
_logger = logging.getLogger(__name__)
@@ -52,9 +52,9 @@ if 'REDDWARFCLIENT_DEBUG' in os.environ and os.environ['REDDWARFCLIENT_DEBUG']:
log_to_streamhandler()
-class ReddwarfHTTPClient(httplib2.Http):
+class TroveHTTPClient(httplib2.Http):
- USER_AGENT = 'python-reddwarfclient'
+ USER_AGENT = 'python-troveclient'
def __init__(self, user, password, tenant, auth_url, service_name,
service_url=None,
@@ -64,7 +64,7 @@ class ReddwarfHTTPClient(httplib2.Http):
endpoint_type='publicURL', service_type=None,
timings=False):
- super(ReddwarfHTTPClient, self).__init__(timeout=timeout)
+ super(TroveHTTPClient, self).__init__(timeout=timeout)
self.username = user
self.password = password
@@ -130,7 +130,7 @@ class ReddwarfHTTPClient(httplib2.Http):
_logger.debug("RESP:%s %s\n", resp, body)
def pretty_log(self, args, kwargs, resp, body):
- from reddwarfclient import common
+ from troveclient import common
if not _logger.isEnabledFor(logging.DEBUG):
return
@@ -170,7 +170,7 @@ class ReddwarfHTTPClient(httplib2.Http):
kwargs['headers']['User-Agent'] = self.USER_AGENT
self.morph_request(kwargs)
- resp, body = super(ReddwarfHTTPClient, self).request(*args, **kwargs)
+ resp, body = super(TroveHTTPClient, self).request(*args, **kwargs)
# Save this in case anyone wants it.
self.last_response = (resp, body)
@@ -297,26 +297,26 @@ class Dbaas(object):
"""
def __init__(self, username, api_key, tenant=None, auth_url=None,
- service_type='database', service_name='reddwarf',
+ service_type='database', service_name='trove',
service_url=None, insecure=False, auth_strategy='keystone',
- region_name=None, client_cls=ReddwarfHTTPClient):
- from reddwarfclient.versions import Versions
- from reddwarfclient.databases import Databases
- from reddwarfclient.flavors import Flavors
- from reddwarfclient.instances import Instances
- from reddwarfclient.limits import Limits
- from reddwarfclient.users import Users
- from reddwarfclient.root import Root
- from reddwarfclient.hosts import Hosts
- from reddwarfclient.quota import Quotas
- from reddwarfclient.backups import Backups
- from reddwarfclient.security_groups import SecurityGroups
- from reddwarfclient.security_groups import SecurityGroupRules
- from reddwarfclient.storage import StorageInfo
- from reddwarfclient.management import Management
- from reddwarfclient.accounts import Accounts
- from reddwarfclient.diagnostics import DiagnosticsInterrogator
- from reddwarfclient.diagnostics import HwInfoInterrogator
+ region_name=None, client_cls=TroveHTTPClient):
+ from troveclient.versions import Versions
+ from troveclient.databases import Databases
+ from troveclient.flavors import Flavors
+ from troveclient.instances import Instances
+ from troveclient.limits import Limits
+ from troveclient.users import Users
+ from troveclient.root import Root
+ from troveclient.hosts import Hosts
+ from troveclient.quota import Quotas
+ from troveclient.backups import Backups
+ from troveclient.security_groups import SecurityGroups
+ from troveclient.security_groups import SecurityGroupRules
+ from troveclient.storage import StorageInfo
+ from troveclient.management import Management
+ from troveclient.accounts import Accounts
+ from troveclient.diagnostics import DiagnosticsInterrogator
+ from troveclient.diagnostics import HwInfoInterrogator
self.client = client_cls(username, api_key, tenant, auth_url,
service_type=service_type,
diff --git a/reddwarfclient/common.py b/troveclient/common.py
index 9c66c49..d10fb22 100644
--- a/reddwarfclient/common.py
+++ b/troveclient/common.py
@@ -19,9 +19,9 @@ import os
import pickle
import sys
-from reddwarfclient import client
-from reddwarfclient.xml import ReddwarfXmlClient
-from reddwarfclient import exceptions
+from troveclient import client
+from troveclient.xml import TroveXmlClient
+from troveclient import exceptions
from urllib import quote
@@ -92,7 +92,7 @@ class CliOptions(object):
'auth_url': None,
'auth_type': 'keystone',
'service_type': 'database',
- 'service_name': 'reddwarf',
+ 'service_name': 'trove',
'region': 'RegionOne',
'service_url': None,
'insecure': False,
@@ -204,9 +204,9 @@ class CommandsBase(object):
"""Creates the all important client object."""
try:
if self.xml:
- client_cls = ReddwarfXmlClient
+ client_cls = TroveXmlClient
else:
- client_cls = client.ReddwarfHTTPClient
+ client_cls = client.TroveHTTPClient
if self.verbose:
client.log_to_streamhandler(sys.stdout)
client.RDC_PP = True
diff --git a/reddwarfclient/databases.py b/troveclient/databases.py
index d7f31e1..09157d3 100644
--- a/reddwarfclient/databases.py
+++ b/troveclient/databases.py
@@ -1,7 +1,7 @@
-from reddwarfclient import base
-from reddwarfclient.common import check_for_exceptions
-from reddwarfclient.common import limit_url
-from reddwarfclient.common import Paginated
+from troveclient import base
+from troveclient.common import check_for_exceptions
+from troveclient.common import limit_url
+from troveclient.common import Paginated
import exceptions
import urlparse
diff --git a/reddwarfclient/diagnostics.py b/troveclient/diagnostics.py
index 06da06c..311a7c9 100644
--- a/reddwarfclient/diagnostics.py
+++ b/troveclient/diagnostics.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
import exceptions
diff --git a/reddwarfclient/exceptions.py b/troveclient/exceptions.py
index 88c3f7e..88c3f7e 100644
--- a/reddwarfclient/exceptions.py
+++ b/troveclient/exceptions.py
diff --git a/reddwarfclient/flavors.py b/troveclient/flavors.py
index ba01a5f..02fef33 100644
--- a/reddwarfclient/flavors.py
+++ b/troveclient/flavors.py
@@ -14,11 +14,11 @@
# under the License.
-from reddwarfclient import base
+from troveclient import base
import exceptions
-from reddwarfclient.common import check_for_exceptions
+from troveclient.common import check_for_exceptions
class Flavor(base.Resource):
diff --git a/reddwarfclient/hosts.py b/troveclient/hosts.py
index fb03d37..3e7ecc2 100644
--- a/reddwarfclient/hosts.py
+++ b/troveclient/hosts.py
@@ -13,9 +13,9 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
-from reddwarfclient.common import check_for_exceptions
+from troveclient.common import check_for_exceptions
class Host(base.Resource):
diff --git a/reddwarfclient/instances.py b/troveclient/instances.py
index 66b091c..16e8a6b 100644
--- a/reddwarfclient/instances.py
+++ b/troveclient/instances.py
@@ -13,14 +13,14 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
import exceptions
import urlparse
-from reddwarfclient.common import check_for_exceptions
-from reddwarfclient.common import limit_url
-from reddwarfclient.common import Paginated
+from troveclient.common import check_for_exceptions
+from troveclient.common import limit_url
+from troveclient.common import Paginated
REBOOT_SOFT, REBOOT_HARD = 'SOFT', 'HARD'
diff --git a/reddwarfclient/limits.py b/troveclient/limits.py
index f2b8703..96d2fca 100644
--- a/reddwarfclient/limits.py
+++ b/troveclient/limits.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
import exceptions
diff --git a/reddwarfclient/management.py b/troveclient/management.py
index 931c0d5..1e17f92 100644
--- a/reddwarfclient/management.py
+++ b/troveclient/management.py
@@ -13,13 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
import urlparse
-from reddwarfclient.common import check_for_exceptions
-from reddwarfclient.common import limit_url
-from reddwarfclient.common import Paginated
-from reddwarfclient.instances import Instance
+from troveclient.common import check_for_exceptions
+from troveclient.common import limit_url
+from troveclient.common import Paginated
+from troveclient.instances import Instance
class RootHistory(base.Resource):
diff --git a/reddwarfclient/mcli.py b/troveclient/mcli.py
index 62371cc..87179c1 100644
--- a/reddwarfclient/mcli.py
+++ b/troveclient/mcli.py
@@ -15,7 +15,7 @@
# under the License.
"""
-Reddwarf Management Command line tool
+Trove Management Command line tool
"""
import json
@@ -24,17 +24,17 @@ import os
import sys
-# If ../reddwarf/__init__.py exists, add ../ to Python search path, so that
+# If ../trove/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in /usr/(local/)lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
os.pardir,
os.pardir))
-if os.path.exists(os.path.join(possible_topdir, 'reddwarfclient',
+if os.path.exists(os.path.join(possible_topdir, 'troveclient',
'__init__.py')):
sys.path.insert(0, possible_topdir)
-from reddwarfclient import common
+from troveclient import common
oparser = None
diff --git a/reddwarfclient/quota.py b/troveclient/quota.py
index e5a8f74..aca7ef8 100644
--- a/reddwarfclient/quota.py
+++ b/troveclient/quota.py
@@ -13,8 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
-from reddwarfclient.common import check_for_exceptions
+from troveclient import base
+from troveclient.common import check_for_exceptions
class Quotas(base.ManagerWithFind):
diff --git a/reddwarfclient/root.py b/troveclient/root.py
index 33b0da7..e9768af 100644
--- a/reddwarfclient/root.py
+++ b/troveclient/root.py
@@ -13,10 +13,10 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
-from reddwarfclient import users
-from reddwarfclient.common import check_for_exceptions
+from troveclient import users
+from troveclient.common import check_for_exceptions
import exceptions
diff --git a/reddwarfclient/security_groups.py b/troveclient/security_groups.py
index d26cc86..caece79 100644
--- a/reddwarfclient/security_groups.py
+++ b/troveclient/security_groups.py
@@ -14,13 +14,13 @@
# under the License.
#
-from reddwarfclient import base
+from troveclient import base
import exceptions
import urlparse
-from reddwarfclient.common import limit_url
-from reddwarfclient.common import Paginated
+from troveclient.common import limit_url
+from troveclient.common import Paginated
class SecurityGroup(base.Resource):
diff --git a/reddwarfclient/storage.py b/troveclient/storage.py
index 653096e..67d332b 100644
--- a/reddwarfclient/storage.py
+++ b/troveclient/storage.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
class Device(base.Resource):
diff --git a/troveclient/tests/__init__.py b/troveclient/tests/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/troveclient/tests/__init__.py
diff --git a/reddwarfclient/tests/test_accounts.py b/troveclient/tests/test_accounts.py
index ec76f13..e2716fa 100644
--- a/reddwarfclient/tests/test_accounts.py
+++ b/troveclient/tests/test_accounts.py
@@ -1,8 +1,8 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import accounts
-from reddwarfclient import base
+from troveclient import accounts
+from troveclient import base
"""
Unit tests for accounts.py
diff --git a/reddwarfclient/tests/test_auth.py b/troveclient/tests/test_auth.py
index f1c4b59..28cecb9 100644
--- a/reddwarfclient/tests/test_auth.py
+++ b/troveclient/tests/test_auth.py
@@ -1,10 +1,10 @@
import contextlib
from testtools import TestCase
-from reddwarfclient import auth
+from troveclient import auth
from mock import Mock
-from reddwarfclient import exceptions
+from troveclient import exceptions
"""
Unit tests for the classes and functions in auth.py.
@@ -129,8 +129,8 @@ class KeyStoneV2AuthenticatorTest(TestCase):
self.assertEqual(url, r)
def test__v2_auth(self):
- username = "reddwarf_user"
- password = "reddwarf_password"
+ username = "trove_user"
+ password = "trove_password"
tenant = "tenant"
cls_type = auth.KeyStoneV2Authenticator
authObj = auth.KeyStoneV2Authenticator(url=None, type=cls_type,
@@ -159,8 +159,8 @@ class Auth1_1Test(TestCase):
check_url_none(self, auth.Auth1_1)
# url is not none
- username = "reddwarf_user"
- password = "reddwarf_password"
+ username = "trove_user"
+ password = "trove_password"
url = "test_url"
authObj = auth.Auth1_1(url=url,
type=auth.Auth1_1,
@@ -204,8 +204,8 @@ class RaxAuthenticatorTest(TestCase):
self.assertEqual(url, r)
def test__rax_auth(self):
- username = "reddwarf_user"
- password = "reddwarf_password"
+ username = "trove_user"
+ password = "trove_password"
tenant = "tenant"
authObj = auth.RaxAuthenticator(url=None,
type=auth.RaxAuthenticator,
@@ -359,12 +359,12 @@ class ServiceCatalogTest(TestCase):
self.assertEqual(self.test_url, r_url)
def case_ambiguous_endpoint(self, scObj):
- scObj.service_type = "reddwarf"
+ scObj.service_type = "trove"
scObj.service_name = "test_service_name"
def side_effect_func_service(key):
if key == "type":
- return "reddwarf"
+ return "trove"
elif key == "name":
return "test_service_name"
return None
diff --git a/reddwarfclient/tests/test_base.py b/troveclient/tests/test_base.py
index 5cbd590..ac7318b 100644
--- a/reddwarfclient/tests/test_base.py
+++ b/troveclient/tests/test_base.py
@@ -4,9 +4,9 @@ import os
from testtools import TestCase
from mock import Mock
-from reddwarfclient import base
-from reddwarfclient import exceptions
-from reddwarfclient import utils
+from troveclient import base
+from troveclient import exceptions
+from troveclient import utils
"""
Unit tests for base.py
diff --git a/reddwarfclient/tests/test_client.py b/troveclient/tests/test_client.py
index d52331f..263316b 100644
--- a/reddwarfclient/tests/test_client.py
+++ b/troveclient/tests/test_client.py
@@ -7,9 +7,9 @@ import time
from testtools import TestCase
from mock import Mock
-from reddwarfclient import client
-from reddwarfclient import exceptions
-from reddwarfclient import utils
+from troveclient import client
+from troveclient import exceptions
+from troveclient import utils
"""
Unit tests for client.py
@@ -23,13 +23,13 @@ class ClientTest(TestCase):
self.assertTrue(client._logger.level == logging.DEBUG)
-class ReddwarfHTTPClientTest(TestCase):
+class TroveHTTPClientTest(TestCase):
def setUp(self):
- super(ReddwarfHTTPClientTest, self).setUp()
- self.orig__init = client.ReddwarfHTTPClient.__init__
- client.ReddwarfHTTPClient.__init__ = Mock(return_value=None)
- self.hc = client.ReddwarfHTTPClient()
+ super(TroveHTTPClientTest, self).setUp()
+ self.orig__init = client.TroveHTTPClient.__init__
+ client.TroveHTTPClient.__init__ = Mock(return_value=None)
+ self.hc = client.TroveHTTPClient()
self.hc.auth_token = "test-auth-token"
self.hc.service_url = "test-service-url/"
self.hc.tenant = "test-tenant"
@@ -43,8 +43,8 @@ class ReddwarfHTTPClientTest(TestCase):
self.orig_htttp_request = httplib2.Http.request
def tearDown(self):
- super(ReddwarfHTTPClientTest, self).tearDown()
- client.ReddwarfHTTPClient.__init__ = self.orig__init
+ super(TroveHTTPClientTest, self).tearDown()
+ client.TroveHTTPClient.__init__ = self.orig__init
client._logger = self.orig_client__logger
time.time = self.orig_time
httplib2.Http.request = self.orig_htttp_request
@@ -53,7 +53,7 @@ class ReddwarfHTTPClientTest(TestCase):
self.__debug_lines.append(s)
def test___init__(self):
- client.ReddwarfHTTPClient.__init__ = self.orig__init
+ client.TroveHTTPClient.__init__ = self.orig__init
user = "test-user"
password = "test-password"
@@ -62,15 +62,15 @@ class ReddwarfHTTPClientTest(TestCase):
service_name = None
# when there is no auth_strategy provided
- self.assertRaises(ValueError, client.ReddwarfHTTPClient, user,
+ self.assertRaises(ValueError, client.TroveHTTPClient, user,
password, tenant, auth_url, service_name)
- hc = client.ReddwarfHTTPClient(user, password, tenant, auth_url,
+ hc = client.TroveHTTPClient(user, password, tenant, auth_url,
service_name, auth_strategy="fake")
self.assertEqual("http://test-auth-url", hc.auth_url)
# auth_url is none
- hc = client.ReddwarfHTTPClient(user, password, tenant, None,
+ hc = client.TroveHTTPClient(user, password, tenant, None,
service_name, auth_strategy="fake")
self.assertEqual(None, hc.auth_url)
@@ -157,7 +157,7 @@ class ReddwarfHTTPClientTest(TestCase):
status_list = [400, 401, 403, 404, 408, 409, 413, 500, 501]
for status in status_list:
resp.status = status
- self.assertRaises(ValueError, self.hc.request)
+ self.assertRaises(Exception, self.hc.request)
exception = exceptions.ResponseFormatError
self.hc.morph_response_body = Mock(side_effect=exception)
@@ -171,7 +171,7 @@ class ReddwarfHTTPClientTest(TestCase):
status_list = [400, 401, 403, 404, 408, 409, 413, 500, 501]
for status in status_list:
resp.status = status
- self.assertRaises(ValueError,
+ self.assertRaises(Exception,
self.hc.raise_error_from_status, resp, Mock())
def test_morph_request(self):
@@ -293,16 +293,16 @@ class DbaasTest(TestCase):
def setUp(self):
super(DbaasTest, self).setUp()
- self.orig__init = client.ReddwarfHTTPClient.__init__
- client.ReddwarfHTTPClient.__init__ = Mock(return_value=None)
+ self.orig__init = client.TroveHTTPClient.__init__
+ client.TroveHTTPClient.__init__ = Mock(return_value=None)
self.dbaas = client.Dbaas("user", "api-key")
def tearDown(self):
super(DbaasTest, self).tearDown()
- client.ReddwarfHTTPClient.__init__ = self.orig__init
+ client.TroveHTTPClient.__init__ = self.orig__init
def test___init__(self):
- client.ReddwarfHTTPClient.__init__ = Mock(return_value=None)
+ client.TroveHTTPClient.__init__ = Mock(return_value=None)
self.assertNotEqual(None, self.dbaas.mgmt)
def test_set_management_url(self):
diff --git a/reddwarfclient/tests/test_common.py b/troveclient/tests/test_common.py
index b038a05..e1b488a 100644
--- a/reddwarfclient/tests/test_common.py
+++ b/troveclient/tests/test_common.py
@@ -6,8 +6,8 @@ import collections
from testtools import TestCase
from mock import Mock
-from reddwarfclient import common
-from reddwarfclient import client
+from troveclient import common
+from troveclient import client
"""
unit tests for common.py
@@ -41,7 +41,7 @@ class CommonTest(TestCase):
for s in status:
resp = Mock()
resp.status = s
- self.assertRaises(ValueError,
+ self.assertRaises(Exception,
common.check_for_exceptions, resp, "body")
# a no-exception case
@@ -82,7 +82,7 @@ class CliOptionsTest(TestCase):
self.assertEqual(None, co.auth_url)
self.assertEqual('keystone', co.auth_type)
self.assertEqual('database', co.service_type)
- self.assertEqual('reddwarf', co.service_name)
+ self.assertEqual('trove', co.service_name)
self.assertEqual('RegionOne', co.region)
self.assertEqual(None, co.service_url)
self.assertFalse(co.insecure)
diff --git a/reddwarfclient/tests/test_instances.py b/troveclient/tests/test_instances.py
index 2131d26..05e4019 100644
--- a/reddwarfclient/tests/test_instances.py
+++ b/troveclient/tests/test_instances.py
@@ -1,8 +1,8 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import instances
-from reddwarfclient import base
+from troveclient import instances
+from troveclient import base
"""
Unit tests for instances.py
@@ -118,7 +118,7 @@ class InstancesTest(TestCase):
self.instances.api.client.delete = Mock(return_value=(resp, body))
self.instances.delete('instance1')
resp.status = 500
- self.assertRaises(ValueError, self.instances.delete, 'instance1')
+ self.assertRaises(Exception, self.instances.delete, 'instance1')
def test__action(self):
body = Mock()
diff --git a/reddwarfclient/tests/test_limits.py b/troveclient/tests/test_limits.py
index fda182c..d40b646 100644
--- a/reddwarfclient/tests/test_limits.py
+++ b/troveclient/tests/test_limits.py
@@ -1,6 +1,6 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import limits
+from troveclient import limits
class LimitsTest(TestCase):
diff --git a/reddwarfclient/tests/test_management.py b/troveclient/tests/test_management.py
index 810961a..c04e216 100644
--- a/reddwarfclient/tests/test_management.py
+++ b/troveclient/tests/test_management.py
@@ -1,8 +1,8 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import management
-from reddwarfclient import base
+from troveclient import management
+from troveclient import base
"""
Unit tests for management.py
@@ -96,7 +96,7 @@ class ManagementTest(TestCase):
self.management._action(1, 'body')
self.assertEqual(1, self.management.api.client.post.call_count)
resp.status = 400
- self.assertRaises(ValueError, self.management._action, 1, 'body')
+ self.assertRaises(Exception, self.management._action, 1, 'body')
self.assertEqual(2, self.management.api.client.post.call_count)
def _mock_action(self):
diff --git a/reddwarfclient/tests/test_secgroups.py b/troveclient/tests/test_secgroups.py
index 25b4de8..779d01e 100644
--- a/reddwarfclient/tests/test_secgroups.py
+++ b/troveclient/tests/test_secgroups.py
@@ -1,8 +1,8 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import security_groups
-from reddwarfclient import base
+from troveclient import security_groups
+from troveclient import base
"""
Unit tests for security_groups.py
@@ -98,5 +98,5 @@ class SecGroupRuleTest(TestCase):
Mock(return_value=(resp, body))
self.security_group_rules.delete(self.id)
resp.status = 500
- self.assertRaises(ValueError, self.security_group_rules.delete,
+ self.assertRaises(Exception, self.security_group_rules.delete,
self.id)
diff --git a/reddwarfclient/tests/test_users.py b/troveclient/tests/test_users.py
index 80be05f..0fc32f6 100644
--- a/reddwarfclient/tests/test_users.py
+++ b/troveclient/tests/test_users.py
@@ -1,8 +1,8 @@
from testtools import TestCase
from mock import Mock
-from reddwarfclient import users
-from reddwarfclient import base
+from troveclient import users
+from troveclient import base
"""
Unit tests for users.py
diff --git a/reddwarfclient/tests/test_utils.py b/troveclient/tests/test_utils.py
index c3a000d..12ee9d0 100644
--- a/reddwarfclient/tests/test_utils.py
+++ b/troveclient/tests/test_utils.py
@@ -1,7 +1,7 @@
import os
from testtools import TestCase
-from reddwarfclient import utils
-from reddwarfclient import versions
+from troveclient import utils
+from troveclient import versions
class UtilsTest(TestCase):
diff --git a/reddwarfclient/tests/test_xml.py b/troveclient/tests/test_xml.py
index cda382b..96490ce 100644
--- a/reddwarfclient/tests/test_xml.py
+++ b/troveclient/tests/test_xml.py
@@ -1,6 +1,6 @@
from testtools import TestCase
from lxml import etree
-from reddwarfclient import xml
+from troveclient import xml
class XmlTest(TestCase):
@@ -205,10 +205,10 @@ class XmlTest(TestCase):
test_list = xml.modify_response_types(test_list["a_list"], TYPE_MAP)
self.assertEqual([{'Int': 5}, {'Str': 'A'}], test_list)
- def test_reddwarfxmlclient(self):
- from reddwarfclient import exceptions
+ def test_trovexmlclient(self):
+ from troveclient import exceptions
- client = xml.ReddwarfXmlClient("user", "password", "tenant",
+ client = xml.TroveXmlClient("user", "password", "tenant",
"auth_url", "service_name",
auth_strategy="fake")
request = {'headers': {}}
diff --git a/reddwarfclient/users.py b/troveclient/users.py
index 344252c..acf99ca 100644
--- a/reddwarfclient/users.py
+++ b/troveclient/users.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
-from reddwarfclient import databases
-from reddwarfclient.common import check_for_exceptions
-from reddwarfclient.common import limit_url
-from reddwarfclient.common import Paginated
-from reddwarfclient.common import quote_user_host
+from troveclient import base
+from troveclient import databases
+from troveclient.common import check_for_exceptions
+from troveclient.common import limit_url
+from troveclient.common import Paginated
+from troveclient.common import quote_user_host
import exceptions
import urlparse
diff --git a/reddwarfclient/utils.py b/troveclient/utils.py
index 3deb806..3deb806 100644
--- a/reddwarfclient/utils.py
+++ b/troveclient/utils.py
diff --git a/reddwarfclient/versions.py b/troveclient/versions.py
index f7b52c4..4813a37 100644
--- a/reddwarfclient/versions.py
+++ b/troveclient/versions.py
@@ -13,7 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
-from reddwarfclient import base
+from troveclient import base
class Version(base.Resource):
diff --git a/reddwarfclient/xml.py b/troveclient/xml.py
index fe94f19..d4a7451 100644
--- a/reddwarfclient/xml.py
+++ b/troveclient/xml.py
@@ -2,8 +2,8 @@ from lxml import etree
import json
from numbers import Number
-from reddwarfclient import exceptions
-from reddwarfclient.client import ReddwarfHTTPClient
+from troveclient import exceptions
+from troveclient.client import TroveHTTPClient
XML_NS = {None: "http://docs.openstack.org/database/api/v1.0"}
@@ -262,7 +262,7 @@ def modify_response_types(value, type_translator):
for element in value]
-class ReddwarfXmlClient(ReddwarfHTTPClient):
+class TroveXmlClient(TroveHTTPClient):
@classmethod
def morph_request(self, kwargs):