Rename from reddwarf to trove.

Implements Blueprint reddwarf-trove-rename

Change-Id: Ia9ee609bbc06a1d8b9d6917642529f30347541fd
This commit is contained in:
Michael Basnight 2013-06-19 13:44:44 -07:00
parent 18664fa9d8
commit 7ab80b554d
308 changed files with 1573 additions and 2098 deletions

View File

@ -2,8 +2,8 @@
[run]
branch = True
source=reddwarf
omit=*reddwarf/tests*,*reddwarf/openstack/common*
source=trove
omit=*trove/tests*,*trove/openstack/common*
[report]
# Regexes for lines to exclude from consideration

9
.gitignore vendored
View File

@ -1,13 +1,12 @@
vagrant/
*.pyc
.idea
reddwarf_test.sqlite
trove_test.sqlite
.venv
run_tests.log
guest-agent-files.txt
reddwarf.egg*
trove.egg*
reddwarf/vcsversion.py
trove/vcsversion.py
*py*.egg
.coverage
cover/
@ -17,10 +16,10 @@ host-syslog.log
tags
.tox
rdtest.log
reddwarf/versioninfo
trove/versioninfo
AUTHORS
ChangeLog
reddwarf.iml
trove.iml
atlassian-ide-plugin.xml
.testrepository
.pid

View File

@ -1,4 +1,4 @@
[DEFAULT]
test_command=${PYTHON:-python} -m subunit.run discover ./reddwarf/tests/unittests $LISTOPT $IDOPTION
test_command=${PYTHON:-python} -m subunit.run discover ./trove/tests/unittests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,4 +1,4 @@
include reddwarf/db/sqlalchemy/migrate_repo/migrate.cfg
include reddwarf/db/sqlalchemy/migrate_repo/README
include reddwarf/db/sqlalchemy/migrate_repo/versions/*.sql
include etc/reddwarf/*.*
include trove/db/sqlalchemy/migrate_repo/migrate.cfg
include trove/db/sqlalchemy/migrate_repo/README
include trove/db/sqlalchemy/migrate_repo/versions/*.sql
include etc/trove/*.*

View File

@ -9,10 +9,10 @@ fi
function run() {
.tox/py26/bin/python $@
}
run bin/reddwarf-manage \
--config-file=etc/reddwarf/reddwarf.conf.test db_wipe \
reddwarf_test.sqlite mysql fake
run bin/reddwarf-server \
--fork --config-file=etc/reddwarf/reddwarf.conf.test \
run bin/trove-manage \
--config-file=etc/trove/trove.conf.test db_wipe \
trove_test.sqlite mysql fake
run bin/trove-server \
--fork --config-file=etc/trove/trove.conf.test \
$@

View File

@ -22,21 +22,21 @@ import os
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf.common import cfg
from reddwarf.openstack.common import log as logging
from reddwarf.common import wsgi
from reddwarf.db import get_db_api
from trove.common import cfg
from trove.openstack.common import log as logging
from trove.common import wsgi
from trove.db import get_db_api
CONF = cfg.CONF
@ -48,8 +48,8 @@ if __name__ == '__main__':
try:
get_db_api().configure_db(CONF)
conf_file = CONF.find_file(CONF.api_paste_config)
launcher = wsgi.launch('reddwarf', CONF.bind_port or 8779, conf_file,
workers=CONF.reddwarf_api_workers)
launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file,
workers=CONF.trove_api_workers)
launcher.wait()
except RuntimeError as error:
import traceback

View File

@ -38,25 +38,25 @@ from nova import utils
from nova import wsgi
from nova.openstack.common import cfg
SERVICE_NAME = "reddwarfapi_database"
SERVICE_NAME = "troveapi_database"
reddwarf_opts = [
cfg.StrOpt('reddwarf_api_paste_config',
default='reddwarf-api-paste.ini',
trove_opts = [
cfg.StrOpt('trove_api_paste_config',
default='trove-api-paste.ini',
help='Reddwarf API paste config'),
# port magic in service.WSGIService the name of the app has to be the same
# as the name of the service
cfg.IntOpt('%s_listen_port' % SERVICE_NAME,
default=8779,
help='Reddwarf API default port'),
cfg.MultiStrOpt('reddwarf_api_extension',
cfg.MultiStrOpt('trove_api_extension',
default=[
'reddwarf.api.database.contrib.standard_extensions'
'trove.api.database.contrib.standard_extensions'
],
help='osapi compute extension to load'),
]
FLAGS = flags.FLAGS
FLAGS.register_opts(reddwarf_opts)
FLAGS.register_opts(trove_opts)
if __name__ == '__main__':
@ -64,7 +64,7 @@ if __name__ == '__main__':
flags.FLAGS(sys.argv)
logging.setup()
utils.monkey_patch()
loader = wsgi.Loader(config_path=FLAGS.reddwarf_api_paste_config)
loader = wsgi.Loader(config_path=FLAGS.trove_api_paste_config)
server = service.WSGIService(SERVICE_NAME, loader=loader)
service.serve(server)
service.wait()

View File

@ -24,19 +24,19 @@ 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)
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarfclient import common
from troveclient import common
oparser = None

View File

@ -26,23 +26,23 @@ import socket
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf.common import cfg
from reddwarf.common import rpc
from reddwarf.guestagent import dbaas
from trove.common import cfg
from trove.common import rpc
from trove.guestagent import dbaas
from oslo.config import cfg as openstack_cfg
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import service
from reddwarf.db import get_db_api
from trove.openstack.common import log as logging
from trove.openstack.common import service
from trove.db import get_db_api
CONF = cfg.CONF
CONF.register_opts([openstack_cfg.StrOpt('guestagent_manager'),

View File

@ -23,24 +23,24 @@ import os
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf import version
from reddwarf.common import cfg
from reddwarf.common import utils
from reddwarf.db import get_db_api
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import uuidutils
from reddwarf.instance import models as instance_models
from trove import version
from trove.common import cfg
from trove.common import utils
from trove.db import get_db_api
from trove.openstack.common import log as logging
from trove.openstack.common import uuidutils
from trove.instance import models as instance_models
CONF = cfg.CONF
@ -83,8 +83,8 @@ class Commands(object):
def db_wipe(self, repo_path, service_name, image_id):
"""Drops the database and recreates it."""
from reddwarf.instance import models
from reddwarf.db.sqlalchemy import session
from trove.instance import models
from trove.db.sqlalchemy import session
self.db_api.drop_db(CONF)
self.db_sync()
# Sets up database engine, so the next line will work...

View File

@ -25,23 +25,23 @@ import os
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf.common import cfg
from reddwarf.common import rpc
from trove.common import cfg
from trove.common import rpc
from oslo.config import cfg as openstack_cfg
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import service
from reddwarf.db import get_db_api
from trove.openstack.common import log as logging
from trove.openstack.common import service
from trove.db import get_db_api
CONF = cfg.CONF
CONF.register_opts([openstack_cfg.StrOpt('taskmanager_manager')])

View File

@ -22,22 +22,22 @@ import os
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf.common import cfg
from trove.common import cfg
from oslo.config import cfg as openstack_cfg
from reddwarf.openstack.common import log as logging
from reddwarf.common import wsgi
from reddwarf.db import get_db_api
from trove.openstack.common import log as logging
from trove.common import wsgi
from trove.db import get_db_api
extra_opts = [
openstack_cfg.BoolOpt('fork',
@ -58,8 +58,8 @@ def run_server():
try:
get_db_api().configure_db(CONF)
conf_file = CONF.find_file(CONF.api_paste_config)
launcher = wsgi.launch('reddwarf', CONF.bind_port or 8779, conf_file,
workers=CONF.reddwarf_api_workers)
launcher = wsgi.launch('trove', CONF.bind_port or 8779, conf_file,
workers=CONF.trove_api_workers)

View File

@ -25,23 +25,23 @@ import os
import sys
gettext.install('reddwarf', unicode=1)
gettext.install('trove', unicode=1)
# 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, 'reddwarf', '__init__.py')):
if os.path.exists(os.path.join(possible_topdir, 'trove', '__init__.py')):
sys.path.insert(0, possible_topdir)
from reddwarf.common import cfg
from reddwarf.common import rpc
from trove.common import cfg
from trove.common import rpc
from oslo.config import cfg as openstack_cfg
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import service
from reddwarf.db import get_db_api
from trove.openstack.common import log as logging
from trove.openstack.common import service
from trove.db import get_db_api
CONF = cfg.CONF
CONF.register_opts([openstack_cfg.StrOpt('taskmanager_manager')])

View File

@ -1,68 +0,0 @@
ONE:
Looks like the on-behalf-of functionality in python novaclient is borked in association w/ keystone
*There are 2 different calls to keystone to get token info, and they return different hash's
*The service catalog borks out if 'access' is not the main key, but in the 2nd case 'token' is the main key.
Modified Files
* novaclient/service_catalog.py
Until this is fixed you need to mod python-novaclient after it gets downloaded via devstack
###### BEGIN PATCH
@@ -44,12 +44,17 @@ class ServiceCatalog(object):
raise novaclient.exceptions.EndpointNotFound()
# We don't always get a service catalog back ...
- if not 'serviceCatalog' in self.catalog['access']:
+ try:
+ if 'serviceCatalog' in self.catalog['access']:
+ # Full catalog ...
+ catalog = self.catalog['access']['serviceCatalog']
+ except KeyError:
+ if 'serviceCatalog' in self.catalog['token']:
+ # Full catalog ...
+ catalog = self.catalog['token']['serviceCatalog']
+ if catalog is None:
return None
- # Full catalog ...
- catalog = self.catalog['access']['serviceCatalog']
-
for service in catalog:
if service.get("type") != service_type:
continue
###### END PATCH
TWO:
funkyness w/ the extensions. the extensions url itself wont load. Seems to have to do with authorization & tenants.
* mitigated in reddwarf/common/extensions.py, see for more information
keystone haves issues with the get endpoints method and causing NotImplementedError/ClientException HTTP/500:
###### BEGIN PATCH
diff --git a/keystone/service.py b/keystone/service.py
index d0d4470..4feb966 100644
--- a/keystone/service.py
+++ b/keystone/service.py
@@ -408,8 +408,17 @@ class TokenController(wsgi.Application):
self.token_api.delete_token(context=context, token_id=token_id)
def endpoints(self, context, token_id):
- """Return a list of endpoints available to the token."""
- raise NotImplementedError()
+ """Return service catalog endpoints."""
+ try:
+ token_ref = self.token_api.get_token(context=context,
+ token_id=token_id)
+ except exception.NotFound:
+ raise exception.Unauthorized()
+
+ catalog_ref = self.catalog_api.get_catalog(context,
+ token_ref['user']['id'],
+ token_ref['tenant']['id'])
+ return {'token': {'serviceCatalog': self._format_catalog(catalog_ref)}}
def _format_authenticate(self, token_ref, roles_ref, catalog_ref):
o = self._format_token(token_ref, roles_ref)
###### END PATCH

View File

@ -1,49 +0,0 @@
EXPECTED_ARGS=1
if [ $# -ne $EXPECTED_ARGS ]
then
echo "Usage: `basename $0` REDDWARF_TOKEN"
exit 65
fi
# Be sure to pass in the token for glance auth
REDDWARF_TOKEN=$1
#
# This takes about ~12 minutes to finish
sudo apt-get -y install kvm-pxe ubuntu-vm-builder
VM_PATH=~/oneiric_mysql_image
UBUNTU_DISTRO="ubuntu 11.10"
UBUNTU_DISTRO_NAME=oneiric
USERNAME=reddwarf
rm -fr $VM_PATH
# Create the guest with the specific files
# Assuming this is run from development/bootstrap/bootstrap.sh
COPY_FILE=guest-agent-files.txt
rm -fr $COPY_FILE
# These will be the way the firstboot script phones home to get the latest guest via scp.
# See bootstrap_init.sh for more info on what it does
echo "$HOME/.ssh/id_rsa.pub /home/$USERNAME/.ssh/id_rsa.pub" >> $COPY_FILE
echo "$HOME/.ssh/id_rsa /home/$USERNAME/.ssh/id_rsa" >> $COPY_FILE
# Now put the pub key in this machines auth keys so the vm can log in to the host (scp)
# TODO(hub-cap): make this better using a ssh command or checking for existence
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
#build a qemu image
sudo ubuntu-vm-builder qemu $UBUNTU_DISTRO_NAME --addpkg vim \
--addpkg mysql-server --addpkg openssh-server \
--copy $COPY_FILE --user $USERNAME --pass $USERNAME \
--firstboot `pwd`/bootstrap_init.sh -d $VM_PATH
QCOW_IMAGE=`find $VM_PATH -name '*.qcow2'`
function get_id () {
echo `$@ | awk '{print $6}'`
}
GLANCE_IMAGEID=`get_id glance add name="${UBUNTU_DISTRO_NAME}_mysql_image" is_public=true \
container_format=ovf disk_format=qcow2 \
distro='"$UBUNTU_DISTRO"' -A $REDDWARF_TOKEN < $QCOW_IMAGE`
echo "Run this query in your db"
echo "update service_images set image_id = '$GLANCE_IMAGEID';"

View File

@ -1,9 +0,0 @@
### THINGS TO NOTE
# Make sure the host code is in /src
# Make sure the username is the same as the vm/host
# ** Assuming the username is reddwarf
# Make sure the host/vm bridge is at 10.0.0.1, which is the default devstack bridge
PATH_TO_HOST=/src/reddwarf
sudo -u reddwarf scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -r 10.0.0.1:${PATH_TO_HOST}/guest-agent ~reddwarf
python ~reddwarf/guest-agent/agent.py

View File

@ -1,44 +0,0 @@
# At this point this script is manual. We will need to work this in to a more automated script.
# NOTE: Im not sure if we need any of this at this point. i will be checking/deleting it shortly.
# see bootstrap/bootstrap.sh
pkg_install () {
echo Installing $@...
sudo -E DEBIAN_FRONTEND=noninteractive $HTTP_PROXY apt-get -y --allow-unauthenticated --force-yes install $@
}
pkg_install debootstrap schroot apt-cacher-ng
# Make sure we sling up apt-cacher ng so each build is faster
echo 'Acquire::http { Proxy "http://127.0.0.1:3142"; };' | sudo tee /etc/apt/apt.conf.d/01proxy
sudo /etc/init.d/apt-cacher-ng restart
# This will wipe an existing schroot conf!
echo '
[oneiric]
description=Ubuntu oneiric
location=/var/chroot/oneiric
priority=3
users=<your user>
groups=sbuild
root-groups=root' | sudo tee /etc/schroot/schroot.conf
sudo rm -fr /var/chroot/oneiric
sudo debootstrap --variant=buildd oneiric /var/chroot/oneiric http://us.archive.ubuntu.com/ubuntu/
sudo mkdir /var/chroot/oneiric/root/.ssh
sudo cp ~/.ssh/id_rsa.pub /var/chroot/oneiric/root/.ssh/authorized_keys
sudo chroot /var/chroot/oneiric
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated --force-yes apt-get install openssh-server
DEBIAN_FRONTEND=noninteractive apt-get -y --allow-unauthenticated --force-yes install mysql-server
exit
#now that u are out of the vm, lets tar it up
cd /var/chroot/oneiric/
sudo tar czvf ../onieric_mysql.tar.gz .
cd ..
glance add -A $REDDWARF_TOKEN name="ubuntu-mysql.img" is_public=true type=raw < onieric_mysql.tar.gz
curl -H"Content-type:application/json" -H'X-Auth-Token:$REDDWARF_TOKEN' \
http://0.0.0.0:8779/v0.1/$REDDWARF_TOKEN/instances \
-d '{"name":"my_test","image":"$IMAGE_ID","flavor":"1"}'

View File

@ -1,121 +0,0 @@
# Steps
# 1 install nova via devstack
# 2 install reddwarf via this (or eventually mod devstack)
# 3 run tempest tests
#Kind of annoying, but the lxml stuff does not work unless u have these installed
sudo apt-get install libxml2-dev libxslt-dev
cd ~
git clone git://github.com/openstack-dev/devstack.git
cd devstack
# Make sure every devstack instance on a new vm will get the default params for novaclient, paste, etc..
# We can change these to external flags in the future
echo "MYSQL_PASSWORD=e1a2c042c828d3566d0a
RABBIT_PASSWORD=f7999d1955c5014aa32c
SERVICE_TOKEN=be19c524ddc92109a224
SERVICE_PASSWORD=3de4922d8b6ac5a1aad9
ADMIN_PASSWORD=3de4922d8b6ac5a1aad9" > localrc
./stack.sh
# Now add a user to keystone that is reddwarf specific. This is what we will use in dev/test to authenticate against keystone
# the get_id is stolen from devstack :D
function get_id () {
echo `$@ | grep id | awk '{print $4}'`
}
# NOTE THIS AUTH TOKEN NEEDS TO BE CHANGED
REDDWARF_TENANT=`get_id keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 tenant-create --name=reddwarf`
REDDWARF_USER=`get_id keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 user-create \
--name=reddwarf --pass="REDDWARF-PASS" --email=reddwarf@example.com`
REDDWARF_ROLE=`get_id keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 role-create --name=reddwarf`
keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 user-role-add --tenant_id $REDDWARF_TENANT \
--user $REDDWARF_USER \
--role $REDDWARF_ROLE
# These are the values
#REDDWARF_TENANT=reddwarf
REDDWARF_TENANT=`keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 tenant-list| grep reddwarf | cut -d ' ' -f 2`
echo $REDDWARF_TENANT
REDDWARF_USER=`keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 user-list| grep reddwarf | cut -d ' ' -f 2`
echo $REDDWARF_USER
REDDWARF_TOKEN=$(curl -d '{"auth":{"passwordCredentials":{"username": "reddwarf", "password": "REDDWARF-PASS"},"tenantName":"reddwarf"}}' -H "Content-type: application/json" http://localhost:35357/v2.0/tokens | python -mjson.tool | grep id | tr -s ' ' | cut -d ' ' -f 3 | sed s/\"/''/g | awk 'NR==2' | cut -d ',' -f 1)
echo $REDDWARF_TOKEN
# Now attempt a login
#curl -d '{"auth":{"passwordCredentials":{"username": "reddwarf", "password": "REDDWARF-PASS"},"tenantName":"reddwarf"}}' \
# -H "Content-type: application/json" http://localhost:35357/v2.0/tokens | python -mjson.tool
# now get a list of instances, which connects over python-novaclient to nova
# NOTE THIS AUTH TOKEN NEEDS TO BE CHANGED
# Also note that keystone uses the tenant id now and _not_ the name
# list instances
# curl -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances | python -mjson.tool
# old create instance:
# curl -H"Content-type:application/json" -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances -d '{"name":"my_test","flavor":"1"}' | python -mjson.tool
# create instance:
# curl -H"Content-type:application/json" -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances -d '{"instance": {"databases": [{"character_set": "utf8", "collate": "utf8_general_ci", "name": "sampledb"}, {"name": "nextround"}], "flavorRef": "http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/flavors/1", "name": "json_rack_instance", "volume": {"size": "2"}}}'| python -mjson.tool
# {
# "instance": {
# "databases": [
# {
# "character_set": "utf8",
# "collate": "utf8_general_ci",
# "name": "sampledb"
# },
# {
# "name": "nextround"
# }
# ],
# "flavorRef": "http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/flavors/1",
# "name": "json_rack_instance",
# "volume": {
# "size": "2"
# }
# }
# }
# DELETE INSTANCE
# curl -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances/id -X DELETE | python -mjson.tool
# update the etc/reddwarf/reddwarf.conf.sample
# add this config setting
# reddwarf_tenant_id = f5f71240a97c411e977452370422d7cc
# sync up the database on first run!
# bin/reddwarf-manage --config-file=etc/reddwarf/reddwarf.conf.sample db_sync
# Also, you should start up the api node like this
# bin/reddwarf-server --config-file=etc/reddwarf/reddwarf.conf.sample
# need to build the image before we can create a new instance
# need an rsa key to build the
# ssh-keygen
# first time build the image for reddwarf
# ./bootstrap/bootstrap.sh
##### re-add image manually #####
VM_PATH=~/oneiric_mysql_image
UBUNTU_DISTRO="ubuntu 11.10"
UBUNTU_DISTRO_NAME=oneiric
QCOW_IMAGE=`find $VM_PATH -name '*.qcow2'`
function get_glance_id () {
echo `$@ | awk '{print $6}'`
}
glance add name="oneiric_mysql_image" is_public=true container_format=ovf disk_format=qcow2 distro='"ubuntu 11.10"' -A $REDDWARF_TOKEN < $QCOW_IMAGE
# GLANCE_IMAGEID=
echo "updating your database - $GLANCE_IMAGEID"
sqlite3 /src/reddwarf_test.sqlite "INSERT INTO service_images VALUES('1', 'database', '$GLANCE_IMAGEID');"
#sqlite3 /src/reddwarf_test.sqlite "UPDATE service_images set image_id='$GLANCE_IMAGEID';"
echo "done GLANCE IMAGE ID = $GLANCE_IMAGEID"
# add the image to the reddwarf database
# get the image id from glance
# glance index -A $REDDWARF_TOKEN
# REDDWARF_IMAGE_ID=a92615d7-a8ba-45ff-b29f-ec2baf6b8348
# (sqlite)
# sqlite3 reddwarf_test.sqlite "insert into service_images values ('$REDDWARF_IMAGE_ID','database', '$REDDWARF_IMAGE_ID');"

View File

@ -1,33 +0,0 @@
#!/bin/bash
function reddwarf_auth {
REDDWARF_TENANT=`keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 tenant-list| grep reddwarf | cut -d ' ' -f 2`
REDDWARF_USER=`keystone --endpoint http://localhost:35357/v2.0 --token be19c524ddc92109a224 user-list| grep reddwarf | cut -d ' ' -f 2`
REDDWARF_TOKEN=$(curl -d '{"auth":{"passwordCredentials":{"username": "reddwarf", "password": "REDDWARF-PASS"},"tenantName":"reddwarf"}}' -H "Content-type: application/json" http://localhost:35357/v2.0/tokens | python -mjson.tool | grep id | tr -s ' ' | cut -d ' ' -f 3 | sed s/\"/''/g | awk 'NR==2' | cut -d ',' -f 1)
export REDDWARF_TENANT
export REDDWARF_USER
export REDDWARF_TOKEN
echo "REDDWARF_TENANT = $REDDWARF_TENANT"
echo "REDDWARF_USER = $REDDWARF_USER"
echo "REDDWARF_TOKEN = $REDDWARF_TOKEN"
}
function create_instance {
FLAVOR_ID=$1
curl -H"Content-type:application/json" -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances -d '{"instance": {"databases": [{"character_set": "utf8", "collate": "utf8_general_ci", "name": "sampledb"}, {"name": "nextround"}], "flavorRef": "http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/flavors/1", "name": "json_rack_instance"}}' | python -mjson.tool
}
function list_instances {
curl -H"X-Auth-Token:$REDDWARF_TOKEN" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances | python -mjson.tool
}
function delete_instance {
INSTANCE_ID=$1
curl -H"X-Auth-Token:$REDDWARF_TOKEN" -H"ACCEPT:application/json" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances/$INSTANCE_ID -X DELETE | python -mjson.tool
}
function show_instance {
INSTANCE_ID=$1
curl -H"X-Auth-Token:$REDDWARF_TOKEN" -H"ACCEPT:application/json" http://0.0.0.0:8779/v0.1/$REDDWARF_TENANT/instances/$INSTANCE_ID | python -mjson.tool
}

View File

@ -1,68 +0,0 @@
--reddwarf_api_paste_config=etc/nova/reddwarf-api-paste.ini
--osapi_compute_listen_port=9000
--sql_connection=mysql://root:e1a2c042c828d3566d0a@127.0.0.1/nova
# Glance
#--image_service=nova.image.glance.GlanceImageService
#
# Nova Network
#--network_manager=reddwarf.network.manager.FlatManager
#--fixed_range=10.0.0.0/26
#--network_size=1
#--flat_network_bridge=br100
# Nova Scheduler
#--scheduler_driver=reddwarf.scheduler.simple.UnforgivingMemoryScheduler
#--max_instance_memory_mb=6144
#
# Nova Volume
# Volume configuration for vagrant vm
#--volume_manager=reddwarf.volume.manager.ReddwarfVolumeManager
#--volume_driver=reddwarf.tests.volume.driver.ISCSITestDriver
#--use_local_volumes=False
#--san_thin_provision=False
#--san_ip=33.33.33.11
#--san_login=vagrant
#--san_privatekey=/home/vagrant/.ssh/id_rsa
#
# Reddwarf Compute Manager
#--compute_manager=reddwarf.compute.manager.ReddwarfComputeManager
#
# Nova Compute
#--connection_type=openvz
#--ovz_ve_private_dir=/var/lib/vz/private/
#--lock_path=/tmp
#--resume_guests_state_on_host_boot=True
##--start_guests_on_host_boot=True
#
## API
#--api_paste_config=/home/vagrant/api-paste_keystone.ini
#--enabled_apis=osapi
#--allow_admin_api=True
#--reddwarf_auth_cache_expire_time=300
#
## Quota Limits
#--quota_instances=10
#--quota_cores=20
#--quota_ram=51200
#--quota_volumes=10
#--quota_gigabytes=10000
#--quota_floating_ips=10
#
## Infrastructure Services
#--sql_connection=mysql://nova:novapass@10.0.4.15/nova
#--sql_min_pool_size=1
#--rabbit_host=10.0.4.15
#
## Logging
#--logfile=/vagrant/nova.log
#--verbose
#--notification_driver=reddwarf.notifier.logfile_notifier
#--notifier_logfile=/vagrant/notification.log
#
## Reaper config
#--reaper_driver=reddwarf.reaper.driver.ReddwarfReaperDriver
#Extra ending line needed so that other conf files can be appended to this one.

View File

@ -1,133 +0,0 @@
############
# Metadata #
############
[composite:metadata]
use = egg:Paste#urlmap
/: metaversions
/latest: meta
/2007-01-19: meta
/2007-03-01: meta
/2007-08-29: meta
/2007-10-10: meta
/2007-12-15: meta
/2008-02-01: meta
/2008-09-01: meta
/2009-04-04: meta
[pipeline:metaversions]
pipeline = ec2faultwrap logrequest metaverapp
[pipeline:meta]
pipeline = ec2faultwrap logrequest metaapp
[app:metaverapp]
paste.app_factory = nova.api.metadata.handler:Versions.factory
[app:metaapp]
paste.app_factory = nova.api.metadata.handler:MetadataRequestHandler.factory
#######
# EC2 #
#######
[composite:ec2]
use = egg:Paste#urlmap
/services/Cloud: ec2cloud
[pipeline:ec2cloud]
pipeline = ec2faultwrap logrequest ec2noauth cloudrequest authorizer validator ec2executor
# NOTE(vish): use the following pipeline for deprecated auth
# pipeline = ec2faultwrap logrequest authenticate cloudrequest authorizer validator ec2executor
# NOTE(vish): use the following pipeline for keystone auth
# pipeline = ec2faultwrap logrequest ec2keystoneauth cloudrequest authorizer validator ec2executor
[filter:ec2faultwrap]
paste.filter_factory = nova.api.ec2:FaultWrapper.factory
[filter:logrequest]
paste.filter_factory = nova.api.ec2:RequestLogging.factory
[filter:ec2lockout]
paste.filter_factory = nova.api.ec2:Lockout.factory
[filter:totoken]
paste.filter_factory = nova.api.ec2:EC2Token.factory
[filter:ec2keystoneauth]
paste.filter_factory = nova.api.ec2:EC2KeystoneAuth.factory
[filter:ec2noauth]
paste.filter_factory = nova.api.ec2:NoAuth.factory
[filter:authenticate]
paste.filter_factory = nova.api.ec2:Authenticate.factory
[filter:cloudrequest]
controller = nova.api.ec2.cloud.CloudController
paste.filter_factory = nova.api.ec2:Requestify.factory
[filter:authorizer]
paste.filter_factory = nova.api.ec2:Authorizer.factory
[filter:validator]
paste.filter_factory = nova.api.ec2:Validator.factory
[app:ec2executor]
paste.app_factory = nova.api.ec2:Executor.factory
#############
# Openstack #
#############
[composite:reddwarfapi_database]
use = call:nova.api.openstack.urlmap:urlmap_factory
/: reddwarfdatabaseversions
#/v1.1: reddwarf_database_api_v2
/v2: reddwarf_database_api_v2
[pipeline:reddwarf_database_api_v2]
pipeline = faultwrap authtoken keystonecontext reddwarf_database_app_v2
#pipeline = faultwrap noauth ratelimit reddwarf_database_app_v2
# NOTE(vish): use the following pipeline for deprecated auth
# pipeline = faultwrap auth ratelimit reddwarf_database_app_v2
# NOTE(vish): use the following pipeline for keystone auth
# pipeline = faultwrap authtoken keystonecontext ratelimit reddwarf_database_app_v2
[filter:faultwrap]
paste.filter_factory = nova.api.openstack:FaultWrapper.factory
[filter:auth]
paste.filter_factory = nova.api.openstack.auth:AuthMiddleware.factory
[filter:noauth]
paste.filter_factory = nova.api.openstack.auth:NoAuthMiddleware.factory
[filter:ratelimit]
paste.filter_factory = nova.api.openstack.compute.limits:RateLimitingMiddleware.factory
[app:reddwarf_database_app_v2]
paste.app_factory = reddwarf.api.database:APIRouter.factory
[pipeline:reddwarfdatabaseversions]
pipeline = faultwrap reddwarfdatabaseversionapp
[app:reddwarfdatabaseversionapp]
paste.app_factory = reddwarf.api.database.versions:Versions.factory
##########
# Shared #
##########
[filter:keystonecontext]
paste.filter_factory = nova.api.auth:NovaKeystoneContext.factory
[filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000/
admin_token = be19c524ddc92109a224

View File

@ -1,41 +0,0 @@
[composite:reddwarf]
use = call:reddwarf.common.wsgi:versioned_urlmap
/: versions
/v1.0: reddwarfapi
[app:versions]
paste.app_factory = reddwarf.versions:app_factory
[pipeline:reddwarfapi]
pipeline = faultwrapper tokenauth authorization contextwrapper ratelimit extensions reddwarfapp
#pipeline = debug extensions reddwarfapp
[filter:extensions]
paste.filter_factory = reddwarf.common.extensions:factory
[filter:tokenauth]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_token = be19c524ddc92109a224
signing_dir = /tmp/keystone-signing-nova
[filter:authorization]
paste.filter_factory = reddwarf.common.auth:AuthorizationMiddleware.factory
[filter:contextwrapper]
paste.filter_factory = reddwarf.common.wsgi:ContextMiddleware.factory
[filter:faultwrapper]
paste.filter_factory = reddwarf.common.wsgi:FaultWrapper.factory
[filter:ratelimit]
paste.filter_factory = reddwarf.common.limits:RateLimitingMiddleware.factory
[app:reddwarfapp]
paste.app_factory = reddwarf.common.api:app_factory
#Add this filter to log request and response for debugging
[filter:debug]
paste.filter_factory = reddwarf.common.wsgi:Debug

View File

@ -1,45 +0,0 @@
[composite:reddwarf]
use = call:reddwarf.common.wsgi:versioned_urlmap
/: versions
/v1.0: reddwarfapi
[app:versions]
paste.app_factory = reddwarf.versions:app_factory
[pipeline:reddwarfapi]
pipeline = faultwrapper tokenauth authorization contextwrapper extensions ratelimit reddwarfapp
#pipeline = debug extensions reddwarfapp
[filter:extensions]
paste.filter_factory = reddwarf.common.extensions:factory
[filter:tokenauth]
paste.filter_factory = reddwarf.tests.fakes.keystone:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000/
admin_token = be19c524ddc92109a224
signing_dir = /tmp/keystone-signing-reddwarf
[filter:authorization]
paste.filter_factory = reddwarf.common.auth:AuthorizationMiddleware.factory
[filter:contextwrapper]
paste.filter_factory = reddwarf.common.wsgi:ContextMiddleware.factory
[filter:faultwrapper]
paste.filter_factory = reddwarf.common.wsgi:FaultWrapper.factory
[filter:ratelimit]
paste.filter_factory = reddwarf.common.limits:RateLimitingMiddleware.factory
[app:reddwarfapp]
paste.app_factory = reddwarf.common.api:app_factory
#Add this filter to log request and response for debugging
[filter:debug]
paste.filter_factory = reddwarf.common.wsgi:Debug

View File

@ -18,22 +18,22 @@
"keystone_code_root":"/opt/stack/keystone",
"keystone_conf":"/etc/keystone/keystone.conf",
"keystone_use_combined":true,
"reddwarf_code_root":"/opt/stack/reddwarf",
"reddwarf_conf":"/tmp/reddwarf.conf",
"reddwarf_version":"v1.0",
"reddwarf_api_updated":"2012-08-01T00:00:00Z",
"reddwarf_must_have_volume":false,
"reddwarf_can_have_volume":true,
"reddwarf_main_instance_has_volume": true,
"reddwarf_max_accepted_volume_size": 25,
"reddwarf_max_instances_per_user": 55,
"reddwarf_max_volumes_per_user": 100,
"trove_code_root":"/opt/stack/trove",
"trove_conf":"/tmp/trove.conf",
"trove_version":"v1.0",
"trove_api_updated":"2012-08-01T00:00:00Z",
"trove_must_have_volume":false,
"trove_can_have_volume":true,
"trove_main_instance_has_volume": true,
"trove_max_accepted_volume_size": 25,
"trove_max_instances_per_user": 55,
"trove_max_volumes_per_user": 100,
"use_reaper":false,
"root_removed_from_instance_api": true,
"root_timestamp_disabled": false,
"openvz_disabled": false,
"management_api_disabled": true,
"dns_instance_entry_factory":"reddwarf.dns.rsdns.driver.RsDnsInstanceEntryFactory",
"dns_instance_entry_factory":"trove.dns.rsdns.driver.RsDnsInstanceEntryFactory",
"sentinel": null
}

View File

@ -5,15 +5,15 @@
"dbaas_url":"http://localhost:8779/v1.0",
"version_url":"http://localhost:8779",
"nova_auth_url":"http://localhost:8779/v1.0/auth",
"reddwarf_auth_url":"http://localhost:8779/v1.0/auth",
"reddwarf_client_insecure":false,
"trove_auth_url":"http://localhost:8779/v1.0/auth",
"trove_client_insecure":false,
"auth_strategy":"fake",
"reddwarf_version":"v1.0",
"reddwarf_api_updated":"2012-08-01T00:00:00Z",
"trove_version":"v1.0",
"trove_api_updated":"2012-08-01T00:00:00Z",
"reddwarf_dns_support":false,
"reddwarf_ip_support":false,
"trove_dns_support":false,
"trove_ip_support":false,
"nova_client": null,
@ -26,7 +26,7 @@
"tenant_id":"admin-1000",
"requirements": {
"is_admin":true,
"services": ["reddwarf"]
"services": ["trove"]
}
},
{
@ -36,7 +36,7 @@
"tenant_id":"2500",
"requirements": {
"is_admin":false,
"services": ["reddwarf"]
"services": ["trove"]
}
},
{
@ -46,7 +46,7 @@
"tenant_id":"3000",
"requirements": {
"is_admin":false,
"services": ["reddwarf"]
"services": ["trove"]
}
}
],

View File

@ -1,4 +1,4 @@
{
"include-files": ["localhost.test.conf"],
"reddwarf_client_cls": "reddwarfclient.xml.ReddwarfXmlClient"
"trove_client_cls": "troveclient.xml.TroveXmlClient"
}

41
etc/trove/api-paste.ini Normal file
View File

@ -0,0 +1,41 @@
[composite:trove]
use = call:trove.common.wsgi:versioned_urlmap
/: versions
/v1.0: troveapi
[app:versions]
paste.app_factory = trove.versions:app_factory
[pipeline:troveapi]
pipeline = faultwrapper tokenauth authorization contextwrapper ratelimit extensions troveapp
#pipeline = debug extensions troveapp
[filter:extensions]
paste.filter_factory = trove.common.extensions:factory
[filter:tokenauth]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
admin_token = be19c524ddc92109a224
signing_dir = /tmp/keystone-signing-nova
[filter:authorization]
paste.filter_factory = trove.common.auth:AuthorizationMiddleware.factory
[filter:contextwrapper]
paste.filter_factory = trove.common.wsgi:ContextMiddleware.factory
[filter:faultwrapper]
paste.filter_factory = trove.common.wsgi:FaultWrapper.factory
[filter:ratelimit]
paste.filter_factory = trove.common.limits:RateLimitingMiddleware.factory
[app:troveapp]
paste.app_factory = trove.common.api:app_factory
#Add this filter to log request and response for debugging
[filter:debug]
paste.filter_factory = trove.common.wsgi:Debug

View File

@ -0,0 +1,45 @@
[composite:trove]
use = call:trove.common.wsgi:versioned_urlmap
/: versions
/v1.0: troveapi
[app:versions]
paste.app_factory = trove.versions:app_factory
[pipeline:troveapi]
pipeline = faultwrapper tokenauth authorization contextwrapper extensions ratelimit troveapp
#pipeline = debug extensions troveapp
[filter:extensions]
paste.filter_factory = trove.common.extensions:factory
[filter:tokenauth]
paste.filter_factory = trove.tests.fakes.keystone:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
auth_host = 127.0.0.1
auth_port = 35357
auth_protocol = http
auth_uri = http://127.0.0.1:5000/
admin_token = be19c524ddc92109a224
signing_dir = /tmp/keystone-signing-trove
[filter:authorization]
paste.filter_factory = trove.common.auth:AuthorizationMiddleware.factory
[filter:contextwrapper]
paste.filter_factory = trove.common.wsgi:ContextMiddleware.factory
[filter:faultwrapper]
paste.filter_factory = trove.common.wsgi:FaultWrapper.factory
[filter:ratelimit]
paste.filter_factory = trove.common.limits:RateLimitingMiddleware.factory
[app:troveapp]
paste.app_factory = trove.common.api:app_factory
#Add this filter to log request and response for debugging
[filter:debug]
paste.filter_factory = trove.common.wsgi:Debug

View File

@ -17,9 +17,9 @@ rabbit_password=f7999d1955c5014aa32c
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
#sql_connection = sqlite:///reddwarf_test.sqlite
sql_connection = mysql://root:e1a2c042c828d3566d0a@10.0.0.1/reddwarf?charset=utf8
#sql_connection = postgresql://reddwarf:reddwarf@10.0.0.1/reddwarf
#sql_connection = sqlite:///trove_test.sqlite
sql_connection = mysql://root:e1a2c042c828d3566d0a@10.0.0.1/trove?charset=utf8
#sql_connection = postgresql://trove:trove@10.0.0.1/trove
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@ -31,10 +31,10 @@ sql_connection = mysql://root:e1a2c042c828d3566d0a@10.0.0.1/reddwarf?charset=utf
sql_idle_timeout = 3600
#DB Api Implementation
db_api_implementation = "reddwarf.db.sqlalchemy.api"
db_api_implementation = "trove.db.sqlalchemy.api"
# Path to the extensions
api_extensions_path = reddwarf/extensions
api_extensions_path = trove/extensions
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
@ -43,11 +43,11 @@ api_extensions_path = reddwarf/extensions
nova_proxy_admin_user = admin
nova_proxy_admin_pass = 3de4922d8b6ac5a1aad9
nova_proxy_admin_tenant_name = admin
reddwarf_auth_url = http://0.0.0.0:5000/v2.0
trove_auth_url = http://0.0.0.0:5000/v2.0
swift_url = http://10.0.0.1:8080/v1/AUTH_
# Manager impl for the taskmanager
guestagent_manager=reddwarf.guestagent.manager.Manager
guestagent_manager=trove.guestagent.manager.Manager
# Root configuration
root_grant = ALL
@ -66,10 +66,10 @@ log_file = logfile.txt
# Strategy information for backups
backup_strategy = InnoBackupEx
backup_namespace = reddwarf.guestagent.strategies.backup.impl
restore_namespace = reddwarf.guestagent.strategies.restore.impl
backup_namespace = trove.guestagent.strategies.backup.impl
restore_namespace = trove.guestagent.strategies.restore.impl
storage_strategy = SwiftStorage
storage_namespace = reddwarf.guestagent.strategies.storage.swift
storage_namespace = trove.guestagent.strategies.storage.swift
backup_swift_container = database_backups
backup_use_gzip_compression = True
backup_use_openssl_encryption = True

View File

@ -11,8 +11,8 @@ rabbit_password=f7999d1955c5014aa32c
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/reddwarf
# sql_connection = mysql://root:root@localhost/reddwarf
sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/trove
# sql_connection = mysql://root:root@localhost/trove
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@ -24,16 +24,16 @@ sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/reddwarf
sql_idle_timeout = 3600
#DB Api Implementation
db_api_implementation = reddwarf.db.sqlalchemy.api
db_api_implementation = trove.db.sqlalchemy.api
# Configuration options for talking to nova via the novaclient.
reddwarf_auth_url = http://0.0.0.0:5000/v2.0
trove_auth_url = http://0.0.0.0:5000/v2.0
nova_compute_url = http://localhost:8774/v2
nova_volume_url = http://localhost:8776/v1
swift_url = http://localhost:8080/v1/AUTH_
# Config options for enabling volume service
reddwarf_volume_support = True
trove_volume_support = True
block_device_mapping = vdb
device_path = /dev/vdb
mount_point = /var/lib/mysql
@ -47,19 +47,19 @@ server_delete_time_out=480
nova_proxy_admin_user = admin
nova_proxy_admin_pass = 3de4922d8b6ac5a1aad9
nova_proxy_admin_tenant_name = admin
reddwarf_auth_url = http://0.0.0.0:5000/v2.0
trove_auth_url = http://0.0.0.0:5000/v2.0
# Manager impl for the taskmanager
taskmanager_manager=reddwarf.taskmanager.manager.Manager
taskmanager_manager=trove.taskmanager.manager.Manager
# Manager sends Exists Notifications
taskmanager_exists_notification = True
exists_notification_transformer = reddwarf.extensions.mgmt.instances.models.NovaNotificationTransformer
exists_notification_transformer = trove.extensions.mgmt.instances.models.NovaNotificationTransformer
exists_notification_ticks = 30
notification_service_id = 2f3ff068-2bfb-4f70-9a9d-a6bb65bc084b
# Reddwarf DNS
reddwarf_dns_support = False
# Trove DNS
trove_dns_support = False
# Guest related conf
agent_heartbeat_time = 10
@ -80,9 +80,9 @@ notifier_queue_virtual_host = /
notifier_queue_transport = memory
# usage notifications
notification_driver=reddwarf.openstack.common.notifier.rpc_notifier
control_exchange=reddwarf
notification_driver=trove.openstack.common.notifier.rpc_notifier
control_exchange=trove
# ============ Logging information =============================
#log_dir = /integration/report
#log_file = reddwarf-taskmanager.log
#log_file = trove-taskmanager.log

View File

@ -12,7 +12,7 @@ bind_host = 0.0.0.0
bind_port = 8779
# Number of child processes to run
#reddwarf_api_workers=5
#trove_api_workers=5
# AMQP Connection info
rabbit_password=f7999d1955c5014aa32c
@ -20,9 +20,9 @@ rabbit_password=f7999d1955c5014aa32c
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
# sql_connection = sqlite:///reddwarf_test.sqlite
sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/reddwarf
#sql_connection = postgresql://reddwarf:reddwarf@localhost/reddwarf
# sql_connection = sqlite:///trove_test.sqlite
sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/trove
#sql_connection = postgresql://trove:trove@localhost/trove
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@ -34,13 +34,13 @@ sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/reddwarf
sql_idle_timeout = 3600
#DB Api Implementation
db_api_implementation = "reddwarf.db.sqlalchemy.api"
db_api_implementation = "trove.db.sqlalchemy.api"
# Path to the extensions
api_extensions_path = reddwarf/extensions
api_extensions_path = trove/extensions
# Configuration options for talking to nova via the novaclient.
reddwarf_auth_url = http://0.0.0.0:5000/v2.0
trove_auth_url = http://0.0.0.0:5000/v2.0
nova_compute_url = http://localhost:8774/v2
nova_volume_url = http://localhost:8776/v1
swift_url = http://localhost:8080/v1/AUTH_
@ -49,7 +49,7 @@ swift_url = http://localhost:8080/v1/AUTH_
add_addresses = True
# Config options for enabling volume service
reddwarf_volume_support = True
trove_volume_support = True
block_device_mapping = vdb
device_path = /dev/vdb
mount_point = /var/lib/mysql
@ -65,8 +65,8 @@ http_post_rate = 200
http_put_rate = 200
http_delete_rate = 200
# Reddwarf DNS
reddwarf_dns_support = False
# Trove DNS
trove_dns_support = False
# Taskmanager queue name
taskmanager_queue = taskmanager
@ -86,12 +86,12 @@ agent_call_high_timeout = 150
# Reboot time out for instances
reboot_time_out = 60
# Reddwarf Security Groups for Instances
reddwarf_security_groups_support = True
reddwarf_security_group_rule_protocol = tcp
reddwarf_security_group_rule_port = 3306
# Trove Security Groups for Instances
trove_security_groups_support = True
trove_security_group_rule_protocol = tcp
trove_security_group_rule_port = 3306
# Reddwarf api-paste file name
# Trove api-paste file name
api_paste_config = api-paste.ini
@ -105,15 +105,15 @@ notifier_queue_port = 5672
notifier_queue_virtual_host = /
notifier_queue_transport = memory
control_exchange = reddwarf
control_exchange = trove
# ============ Logging information =============================
#log_dir = /integration/report
#log_file = reddwarf-api.log
#log_file = trove-api.log
# ============ SSL configuration (and enablement) =============================
# In order to enable SSL for the reddwarf api server, uncomment
# In order to enable SSL for the trove api server, uncomment
# the cert_file and key_file - and of course have those files
# accessible. The existance of those setting and files will
# enable SSL.

View File

@ -2,10 +2,10 @@
# Fake out the remote implementations
remote_implementation = fake
remote_nova_client = reddwarf.tests.fakes.nova.fake_create_nova_client
remote_nova_volume_client = reddwarf.tests.fakes.nova.fake_create_nova_volume_client
remote_guest_client = reddwarf.tests.fakes.guestagent.fake_create_guest_client
remote_swift_client = reddwarf.tests.fakes.swift.fake_create_swift_client
remote_nova_client = trove.tests.fakes.nova.fake_create_nova_client
remote_nova_volume_client = trove.tests.fakes.nova.fake_create_nova_volume_client
remote_guest_client = trove.tests.fakes.guestagent.fake_create_guest_client
remote_swift_client = trove.tests.fakes.swift.fake_create_swift_client
fake_mode_events = eventlet
@ -24,7 +24,7 @@ bind_host = 0.0.0.0
bind_port = 8779
# Number of child processes to run
#reddwarf_api_workers=5
#trove_api_workers=5
# AMQP Connection info
rabbit_password=f7999d1955c5014aa32c
@ -32,9 +32,9 @@ rabbit_password=f7999d1955c5014aa32c
# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
sql_connection = sqlite:///reddwarf_test.sqlite
#sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/reddwarf
#sql_connection = postgresql://reddwarf:reddwarf@localhost/reddwarf
sql_connection = sqlite:///trove_test.sqlite
#sql_connection = mysql://root:e1a2c042c828d3566d0a@localhost/trove
#sql_connection = postgresql://trove:trove@localhost/trove
# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
@ -46,10 +46,10 @@ sql_connection = sqlite:///reddwarf_test.sqlite
sql_idle_timeout = 3600
#DB Api Implementation
db_api_implementation = reddwarf.db.sqlalchemy.api
db_api_implementation = trove.db.sqlalchemy.api
# Path to the extensions
api_extensions_path = reddwarf/extensions
api_extensions_path = trove/extensions
# Configuration options for talking to nova via the novaclient.
# These options are for an admin user in your keystone config.
@ -58,7 +58,7 @@ api_extensions_path = reddwarf/extensions
nova_proxy_admin_user = admin
nova_proxy_admin_pass = 3de4922d8b6ac5a1aad9
nova_proxy_admin_tenant_name = admin
reddwarf_auth_url = http://0.0.0.0:5000/v2.0
trove_auth_url = http://0.0.0.0:5000/v2.0
nova_region_name = RegionOne
nova_service_type = compute
@ -68,7 +68,7 @@ nova_service_name = Compute Service
add_addresses = False
# Config options for enabling volume service
reddwarf_volume_support = True
trove_volume_support = True
nova_volume_service_type = volume
nova_volume_service_name = Volume Service
device_path = /dev/vdb
@ -104,7 +104,7 @@ resize_time_out = 120
revert_time_out = 120
# usage notifications
notification_driver = reddwarf.tests.util.usage
notification_driver = trove.tests.util.usage
# ============ notifer queue kombu connection options ========================
@ -116,27 +116,27 @@ notifier_queue_port = 5672
notifier_queue_virtual_host = /
notifier_queue_transport = memory
control_exchange = reddwarf
control_exchange = trove
paste_config_file=api-paste.ini.test
[composite:reddwarf]
use = call:reddwarf.common.wsgi:versioned_urlmap
[composite:trove]
use = call:trove.common.wsgi:versioned_urlmap
/: versions
/v1.0: reddwarfapi
/v1.0: troveapi
[app:versions]
paste.app_factory = reddwarf.versions:app_factory
paste.app_factory = trove.versions:app_factory
[pipeline:reddwarfapi]
pipeline = faultwrapper tokenauth authorization contextwrapper ratelimit extensions reddwarfapp
# pipeline = debug reddwarfapp
[pipeline:troveapi]
pipeline = faultwrapper tokenauth authorization contextwrapper ratelimit extensions troveapp
# pipeline = debug troveapp
[filter:extensions]
paste.filter_factory = reddwarf.common.extensions:factory
paste.filter_factory = trove.common.extensions:factory
[filter:tokenauth]
paste.filter_factory = reddwarf.tests.fakes.keystone:filter_factory
paste.filter_factory = trove.tests.fakes.keystone:filter_factory
service_protocol = http
service_host = 127.0.0.1
service_port = 5000
@ -147,21 +147,21 @@ auth_uri = http://127.0.0.1:5000/
admin_token = be19c524ddc92109a224
[filter:authorization]
paste.filter_factory = reddwarf.common.auth:AuthorizationMiddleware.factory
paste.filter_factory = trove.common.auth:AuthorizationMiddleware.factory
[filter:contextwrapper]
paste.filter_factory = reddwarf.common.wsgi:ContextMiddleware.factory
paste.filter_factory = trove.common.wsgi:ContextMiddleware.factory
[filter:faultwrapper]
paste.filter_factory = reddwarf.common.wsgi:FaultWrapper.factory
paste.filter_factory = trove.common.wsgi:FaultWrapper.factory
[filter:ratelimit]
paste.filter_factory = reddwarf.common.limits:RateLimitingMiddleware.factory
paste.filter_factory = trove.common.limits:RateLimitingMiddleware.factory
[app:reddwarfapp]
paste.app_factory = reddwarf.common.api:app_factory
[app:troveapp]
paste.app_factory = trove.common.api:app_factory
#Add this filter to log request and response for debugging
[filter:debug]
paste.filter_factory = reddwarf.common.wsgi:Debug
paste.filter_factory = trove.common.wsgi:Debug

View File

@ -3,4 +3,4 @@
# The list of modules to copy from openstack-common
modules=middleware,notifier,rpc,cfg,context,eventlet_backdoor,exception,excutils,fileutils,gettextutils,importutils,iniparser,jsonutils,local,lockutils,log,loopingcall,network_utils,pastedeploy,periodic_task,policy,processutils,service,testutils,threadgroup,timeutils,utils,uuidutils,wsgi
# The base module to hold the copy of openstack.common
base=reddwarf
base=trove

View File

@ -1 +0,0 @@
This is the reddwarf code itself

View File

@ -19,7 +19,7 @@ We have to duplicate a lot of code from the OpenStack client since so much
is different here.
"""
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
import exceptions

View File

@ -4,9 +4,9 @@ import urllib
import sys
import traceback
from reddwarf.common import cfg
from reddwarf.openstack.common import log as logging
from reddwarf.tests.config import CONFIG
from trove.common import cfg
from trove.openstack.common import log as logging
from trove.tests.config import CONFIG
from wsgi_intercept.httplib2_intercept import install as wsgi_install
import proboscis
from eventlet import greenthread
@ -31,24 +31,24 @@ def add_support_for_localization():
gettext.install('nova', unicode=1)
def initialize_reddwarf(config_file):
from reddwarf.openstack.common import pastedeploy
def initialize_trove(config_file):
from trove.openstack.common import pastedeploy
cfg.CONF(args=[],
project='reddwarf',
project='trove',
default_config_files=[config_file])
CONF.use_stderr = False
CONF.log_file = 'rdtest.log'
logging.setup(None)
CONF.bind_port = 8779
CONF.fake_mode_events = 'simulated'
return pastedeploy.paste_deploy_app(config_file, 'reddwarf', {})
return pastedeploy.paste_deploy_app(config_file, 'trove', {})
def initialize_database():
from reddwarf.db import get_db_api
from reddwarf.instance import models
from reddwarf.db.sqlalchemy import session
from trove.db import get_db_api
from trove.instance import models
from trove.db.sqlalchemy import session
db_api = get_db_api()
db_api.drop_db(CONF) # Destroys the database, if it exists.
db_api.db_sync(CONF)
@ -83,7 +83,7 @@ def initialize_fakes(app):
# this queue and call the functions that would normally run in seperate
# threads.
import eventlet
from reddwarf.tests.fakes.common import event_simulator_sleep
from trove.tests.fakes.common import event_simulator_sleep
eventlet.sleep = event_simulator_sleep
greenthread.sleep = event_simulator_sleep
import time
@ -101,8 +101,8 @@ def parse_args_for_test_config():
def replace_poll_until():
from reddwarf.common import utils as rd_utils
from reddwarf.tests import util as test_utils
from trove.common import utils as rd_utils
from trove.tests import util as test_utils
rd_utils.poll_until = test_utils.poll_until
if __name__ == "__main__":
@ -110,11 +110,11 @@ if __name__ == "__main__":
wsgi_install()
add_support_for_localization()
replace_poll_until()
# Load Reddwarf app
# Load Trove app
# Paste file needs absolute path
config_file = os.path.realpath('etc/reddwarf/reddwarf.conf.test')
# 'etc/reddwarf/test-api-paste.ini'
app = initialize_reddwarf(config_file)
config_file = os.path.realpath('etc/trove/trove.conf.test')
# 'etc/trove/test-api-paste.ini'
app = initialize_trove(config_file)
# Initialize sqlite database.
initialize_database()
# Swap out WSGI, httplib, and several sleep functions
@ -124,26 +124,26 @@ if __name__ == "__main__":
test_config_file = parse_args_for_test_config()
CONFIG.load_from_file(test_config_file)
from reddwarf.tests.api import backups
from reddwarf.tests.api import header
from reddwarf.tests.api import limits
from reddwarf.tests.api import flavors
from reddwarf.tests.api import versions
from reddwarf.tests.api import instances
from reddwarf.tests.api import instances_actions
from reddwarf.tests.api import instances_delete
from reddwarf.tests.api import instances_mysql_down
from reddwarf.tests.api import instances_resize
from reddwarf.tests.api import databases
from reddwarf.tests.api import root
from reddwarf.tests.api import users
from reddwarf.tests.api import user_access
from reddwarf.tests.api.mgmt import accounts
from reddwarf.tests.api.mgmt import admin_required
from reddwarf.tests.api.mgmt import instances
from reddwarf.tests.api.mgmt import instances_actions
from reddwarf.tests.api.mgmt import storage
from reddwarf.tests.api.mgmt import malformed_json
from trove.tests.api import backups
from trove.tests.api import header
from trove.tests.api import limits
from trove.tests.api import flavors
from trove.tests.api import versions
from trove.tests.api import instances
from trove.tests.api import instances_actions
from trove.tests.api import instances_delete
from trove.tests.api import instances_mysql_down
from trove.tests.api import instances_resize
from trove.tests.api import databases
from trove.tests.api import root
from trove.tests.api import users
from trove.tests.api import user_access
from trove.tests.api.mgmt import accounts
from trove.tests.api.mgmt import admin_required
from trove.tests.api.mgmt import instances
from trove.tests.api.mgmt import instances_actions
from trove.tests.api.mgmt import storage
from trove.tests.api.mgmt import malformed_json
except Exception as e:
print("Run tests failed: %s" % e)
traceback.print_exc()

View File

@ -5,7 +5,7 @@ set -eu
function usage {
echo "Usage: $0 [OPTION]..."
echo "Run Reddwarf's test suite(s)"
echo "Run Trove's test suite(s)"
echo ""
echo " -V, --virtual-env Always use virtualenv. Install automatically if not present"
echo " -N, --no-virtual-env Don't use virtualenv. Run tests in local environment"
@ -60,7 +60,7 @@ done
# If enabled, tell nose to collect coverage data
if [ $coverage -eq 1 ]; then
noseopts="$noseopts --with-coverage --cover-package=reddwarf"
noseopts="$noseopts --with-coverage --cover-package=trove"
fi
function run_tests {

View File

@ -20,13 +20,13 @@ classifier =
[files]
packages =
reddwarf
trove
scripts =
bin/reddwarf-api
bin/reddwarf-manage
bin/reddwarf-mgmt-taskmanager
bin/reddwarf-server
bin/reddwarf-taskmanager
bin/trove-api
bin/trove-manage
bin/trove-mgmt-taskmanager
bin/trove-server
bin/trove-taskmanager
[global]
setup-hooks =

View File

@ -21,7 +21,7 @@
# under the License.
"""
Installation script for Reddwarf's development virtualenv
Installation script for Trove's development virtualenv
"""
import os
@ -79,7 +79,7 @@ def check_dependencies():
print 'Installing virtualenv via easy_install...',
if not (run_command(['which', 'easy_install']) and
run_command(['easy_install', 'virtualenv'])):
die('ERROR: virtualenv not found.\n\Reddwarf development'
die('ERROR: virtualenv not found.\n\Trove development'
' requires virtualenv, please install it using your'
' favorite package management tool')
print 'done.'
@ -109,21 +109,21 @@ def install_dependencies(venv=VENV):
run_command(['tools/with_venv.sh', '-E', venv, 'pip', 'install', '-r',
requires], redirect_output=False)
# Tell the virtual env how to "import reddwarf"
# Tell the virtual env how to "import trove"
pthfile = os.path.join(venv, "lib", PY_VERSION, "site-packages",
"reddwarf.pth")
"trove.pth")
f = open(pthfile, 'w')
f.write("%s\n" % ROOT)
def print_help():
help = """
Reddwarf development environment setup is complete.
Trove development environment setup is complete.
Reddwarf development uses virtualenv to track and manage Python
Trove development uses virtualenv to track and manage Python
dependencies while in development and testing.
To activate the Reddwarf virtualenv for the extent of your current shell
To activate the Trove virtualenv for the extent of your current shell
session you can run:
$ source .venv/bin/activate

1
trove/README Normal file
View File

@ -0,0 +1 @@
This is the trove code itself

View File

@ -15,10 +15,10 @@
# License for the specific language governing permissions and limitations
# under the License.
"""
:mod:`reddwarf` -- Cloud PaaS Database Platform
:mod:`trove` -- Cloud PaaS Database Platform
===================================
.. automodule:: reddwarf
.. automodule:: trove
:platform: Unix
:synopsis: Platform-As-A-Service Database Cloud
.. moduleauthor:: Michael Basnight <mbasnight@gmail.com>

View File

@ -14,15 +14,15 @@
"""Model classes that form the core of snapshots functionality."""
from reddwarf.common import cfg
from reddwarf.common import exception
from reddwarf.db.models import DatabaseModelBase
from reddwarf.openstack.common import log as logging
from trove.common import cfg
from trove.common import exception
from trove.db.models import DatabaseModelBase
from trove.openstack.common import log as logging
from swiftclient.client import ClientException
from reddwarf.taskmanager import api
from reddwarf.common.remote import create_swift_client
from reddwarf.common import utils
from reddwarf.quota.quota import run_with_quotas
from trove.taskmanager import api
from trove.common.remote import create_swift_client
from trove.common import utils
from trove.quota.quota import run_with_quotas
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@ -58,7 +58,7 @@ class Backup(object):
instance_id = utils.get_id_from_href(instance)
# verify that the instance exist and can perform actions
from reddwarf.instance.models import Instance
from trove.instance.models import Instance
instance_model = Instance.load(context, instance_id)
instance_model.validate_can_perform_action()

View File

@ -15,13 +15,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from reddwarf.common import wsgi
from reddwarf.backup import views
from reddwarf.backup.models import Backup
from reddwarf.common import exception
from reddwarf.common import cfg
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common.gettextutils import _
from trove.common import wsgi
from trove.backup import views
from trove.backup.models import Backup
from trove.common import exception
from trove.common import cfg
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@ -73,5 +73,5 @@ class BackupController(wsgi.Controller):
except KeyError as e:
LOG.error(_("Create Backup Required field(s) "
"- %s") % e)
raise exception.ReddwarfError(
raise exception.TroveError(
"Required element/key - %s was not specified" % e)

View File

@ -14,12 +14,12 @@
import routes
from reddwarf.common import wsgi
from reddwarf.flavor.service import FlavorController
from reddwarf.instance.service import InstanceController
from reddwarf.limits.service import LimitsController
from reddwarf.backup.service import BackupController
from reddwarf.versions import VersionsController
from trove.common import wsgi
from trove.flavor.service import FlavorController
from trove.instance.service import InstanceController
from trove.limits.service import LimitsController
from trove.backup.service import BackupController
from trove.versions import VersionsController
class API(wsgi.Router):

View File

@ -20,9 +20,9 @@ import re
import webob.exc
import wsgi
from reddwarf.common import exception
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common.gettextutils import _
from trove.common import exception
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
LOG = logging.getLogger(__name__)
@ -55,7 +55,7 @@ class AuthorizationMiddleware(wsgi.Middleware):
class TenantBasedAuth(object):
# The paths differ from melange, so the regex must differ as well,
# reddwarf starts with a tenant_id
# trove starts with a tenant_id
tenant_scoped_url = re.compile("/(?P<tenant_id>.*?)/.*")
def authorize(self, request, tenant_id, roles):
@ -73,15 +73,15 @@ class TenantBasedAuth(object):
def admin_context(f):
"""
Verify that the current context has administrative access,
or throw an exception. Reddwarf API functions typically take the form
or throw an exception. Trove API functions typically take the form
function(self, req), or function(self, req, id).
"""
def wrapper(*args, **kwargs):
try:
req = args[1]
context = req.environ.get('reddwarf.context')
context = req.environ.get('trove.context')
except:
raise exception.ReddwarfError("Cannot load request context.")
raise exception.TroveError("Cannot load request context.")
if not context.is_admin:
raise exception.Forbidden("User does not have admin privileges.")
return f(*args, **kwargs)

View File

@ -14,13 +14,13 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Routines for configuring Reddwarf."""
"""Routines for configuring Trove."""
from oslo.config import cfg
common_opts = [
cfg.StrOpt('sql_connection',
default='sqlite:///reddwarf_test.sqlite',
default='sqlite:///trove_test.sqlite',
help='SQL Connection'),
cfg.IntOpt('sql_idle_timeout', default=3600),
cfg.BoolOpt('sql_query_log', default=False),
@ -29,13 +29,13 @@ common_opts = [
help='Path to extensions'),
cfg.StrOpt('api_paste_config',
default="api-paste.ini",
help='File name for the paste.deploy config for reddwarf-api'),
help='File name for the paste.deploy config for trove-api'),
cfg.BoolOpt('add_addresses',
default=False,
help='Whether to add IP addresses to the list operations'),
cfg.BoolOpt('reddwarf_volume_support',
cfg.BoolOpt('trove_volume_support',
default=True,
help='File name for the paste.deploy config for reddwarf-api'),
help='File name for the paste.deploy config for trove-api'),
cfg.ListOpt('admin_roles', default=[]),
cfg.StrOpt('remote_implementation',
default="real",
@ -43,18 +43,18 @@ common_opts = [
cfg.StrOpt('nova_compute_url', default='http://localhost:8774/v2'),
cfg.StrOpt('nova_volume_url', default='http://localhost:8776/v2'),
cfg.StrOpt('swift_url', default='http://localhost:8080/v1/AUTH_'),
cfg.StrOpt('reddwarf_auth_url', default='http://0.0.0.0:5000/v2.0'),
cfg.StrOpt('trove_auth_url', default='http://0.0.0.0:5000/v2.0'),
cfg.StrOpt('host', default='0.0.0.0'),
cfg.IntOpt('report_interval', default=10,
help='The interval in seconds which periodic tasks are run'),
cfg.IntOpt('periodic_interval', default=60),
cfg.BoolOpt('reddwarf_dns_support', default=False),
cfg.StrOpt('db_api_implementation', default='reddwarf.db.sqlalchemy.api'),
cfg.BoolOpt('trove_dns_support', default=False),
cfg.StrOpt('db_api_implementation', default='trove.db.sqlalchemy.api'),
cfg.StrOpt('mysql_pkg', default='mysql-server-5.5'),
cfg.StrOpt('percona_pkg', default='percona-server-server-5.5'),
cfg.StrOpt('dns_driver', default='reddwarf.dns.driver.DnsDriver'),
cfg.StrOpt('dns_driver', default='trove.dns.driver.DnsDriver'),
cfg.StrOpt('dns_instance_entry_factory',
default='reddwarf.dns.driver.DnsInstanceEntryFactory'),
default='trove.dns.driver.DnsInstanceEntryFactory'),
cfg.StrOpt('dns_hostname', default=""),
cfg.IntOpt('dns_account_id', default=0),
cfg.StrOpt('dns_auth_url', default=""),
@ -88,7 +88,7 @@ common_opts = [
cfg.IntOpt('max_backups_per_user', default=5,
help='default maximum number of backups created by a tenant'),
cfg.StrOpt('quota_driver',
default='reddwarf.quota.quota.DbQuotaDriver',
default='trove.quota.quota.DbQuotaDriver',
help='default driver to use for quota checks'),
cfg.StrOpt('taskmanager_queue', default='taskmanager'),
cfg.BoolOpt('use_nova_server_volume', default=False),
@ -112,10 +112,10 @@ common_opts = [
cfg.IntOpt('http_put_rate', default=200),
cfg.BoolOpt('hostname_require_ipv4', default=True,
help="Require user hostnames to be IPv4 addresses."),
cfg.BoolOpt('reddwarf_security_groups_support', default=True),
cfg.StrOpt('reddwarf_security_group_rule_protocol', default='tcp'),
cfg.IntOpt('reddwarf_security_group_rule_port', default=3306),
cfg.IntOpt('reddwarf_api_workers', default=None),
cfg.BoolOpt('trove_security_groups_support', default=True),
cfg.StrOpt('trove_security_group_rule_protocol', default='tcp'),
cfg.IntOpt('trove_security_group_rule_port', default=3306),
cfg.IntOpt('trove_api_workers', default=None),
cfg.IntOpt('usage_sleep_time', default=1,
help='Time to sleep during the check active guest'),
cfg.IntOpt('usage_timeout', default=300,
@ -123,19 +123,19 @@ common_opts = [
cfg.StrOpt('region', default='LOCAL_DEV',
help='The region this service is located.'),
cfg.StrOpt('backup_runner',
default='reddwarf.guestagent.backup.backup_types.InnoBackupEx'),
default='trove.guestagent.backup.backup_types.InnoBackupEx'),
cfg.StrOpt('backup_strategy', default='InnoBackupEx',
help='Default strategy to perform backups'),
cfg.StrOpt('backup_namespace',
default='reddwarf.guestagent.strategies.backup.impl',
default='trove.guestagent.strategies.backup.impl',
help='Namespace to load backup strategies from'),
cfg.StrOpt('restore_namespace',
default='reddwarf.guestagent.strategies.restore.impl',
default='trove.guestagent.strategies.restore.impl',
help='Namespace to load restore strategies from'),
cfg.StrOpt('storage_strategy', default='SwiftStorage',
help="Default strategy to store backups"),
cfg.StrOpt('storage_namespace',
default='reddwarf.guestagent.strategies.storage.swift',
default='trove.guestagent.strategies.storage.swift',
help='Namespace to load the default storage strategy from'),
cfg.StrOpt('backup_swift_container', default='database_backups'),
cfg.BoolOpt('backup_use_gzip_compression', default=True,
@ -151,15 +151,15 @@ common_opts = [
cfg.IntOpt('backup_segment_max_size', default=2 * (1024 ** 3),
help="Maximum size of each segment of the backup file."),
cfg.StrOpt('remote_dns_client',
default='reddwarf.common.remote.dns_client'),
default='trove.common.remote.dns_client'),
cfg.StrOpt('remote_guest_client',
default='reddwarf.common.remote.guest_client'),
default='trove.common.remote.guest_client'),
cfg.StrOpt('remote_nova_client',
default='reddwarf.common.remote.nova_client'),
default='trove.common.remote.nova_client'),
cfg.StrOpt('remote_nova_volume_client',
default='reddwarf.common.remote.nova_volume_client'),
default='trove.common.remote.nova_volume_client'),
cfg.StrOpt('remote_swift_client',
default='reddwarf.common.remote.swift_client'),
default='trove.common.remote.swift_client'),
cfg.BoolOpt('taskmanager_exists_notification', default=False,
help='Toggles Task Manager to send out exists notifications'),
cfg.StrOpt('exists_notification_transformer', default=None,
@ -188,5 +188,5 @@ def custom_parser(parsername, parser):
def parse_args(argv, default_config_files=None):
cfg.CONF(args=argv[1:],
project='reddwarf',
project='trove',
default_config_files=default_config_files)

View File

@ -22,12 +22,12 @@ Projects should subclass this class if they wish to enhance the request
context or provide additional information in their specific WSGI pipeline.
"""
from reddwarf.openstack.common import context
from reddwarf.openstack.common import local
from reddwarf.common import utils
from trove.openstack.common import context
from trove.openstack.common import local
from trove.common import utils
class ReddwarfContext(context.RequestContext):
class TroveContext(context.RequestContext):
"""
Stores information about the security context under which the user
@ -41,13 +41,13 @@ class ReddwarfContext(context.RequestContext):
self.marker = kwargs.get('marker')
if 'marker' in kwargs:
del kwargs['marker']
super(ReddwarfContext, self).__init__(**kwargs)
super(TroveContext, self).__init__(**kwargs)
if not hasattr(local.store, 'context'):
self.update_store()
def to_dict(self):
parent_dict = super(ReddwarfContext, self).to_dict()
parent_dict = super(TroveContext, self).to_dict()
parent_dict.update({'limit': self.limit,
'marker': self.marker
})

View File

@ -16,10 +16,10 @@
# under the License.
"""I totally stole most of this from melange, thx guys!!!"""
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import exception as openstack_exception
from reddwarf.openstack.common import processutils
from reddwarf.openstack.common.gettextutils import _
from trove.openstack.common import log as logging
from trove.openstack.common import exception as openstack_exception
from trove.openstack.common import processutils
from trove.openstack.common.gettextutils import _
from webob import exc
@ -30,8 +30,8 @@ LOG = logging.getLogger(__name__)
wrap_exception = openstack_exception.wrap_exception
class ReddwarfError(openstack_exception.OpenstackException):
"""Base exception that all custom reddwarf app exceptions inherit from."""
class TroveError(openstack_exception.OpenstackException):
"""Base exception that all custom trove app exceptions inherit from."""
internal_message = None
def __init__(self, message=None, **kwargs):
@ -42,25 +42,25 @@ class ReddwarfError(openstack_exception.OpenstackException):
LOG.error(self.internal_message % kwargs)
except Exception:
LOG.error(self.internal_message)
super(ReddwarfError, self).__init__(**kwargs)
super(TroveError, self).__init__(**kwargs)
class DBConstraintError(ReddwarfError):
class DBConstraintError(TroveError):
message = _("Failed to save %(model_name)s because: %(error)s")
class InvalidRPCConnectionReuse(ReddwarfError):
class InvalidRPCConnectionReuse(TroveError):
message = _("Invalid RPC Connection Reuse")
class NotFound(ReddwarfError):
class NotFound(TroveError):
message = _("Resource %(uuid)s cannot be found")
class FlavorNotFound(ReddwarfError):
class FlavorNotFound(TroveError):
message = _("Resource %(uuid)s cannot be found")
@ -88,13 +88,13 @@ class DnsRecordNotFound(NotFound):
message = _("DnsRecord with name= %(name)s not found.")
class OverLimit(ReddwarfError):
class OverLimit(TroveError):
internal_message = _("The server rejected the request due to its size or "
"rate.")
class QuotaExceeded(ReddwarfError):
class QuotaExceeded(TroveError):
message = _("Quota exceeded for resources: %(overs)s")
@ -104,18 +104,18 @@ class VolumeQuotaExceeded(QuotaExceeded):
message = _("Instance volume quota exceeded.")
class GuestError(ReddwarfError):
class GuestError(TroveError):
message = _("An error occurred communicating with the guest: "
"%(original_message)s.")
class GuestTimeout(ReddwarfError):
class GuestTimeout(TroveError):
message = _("Timeout trying to connect to the Guest Agent.")
class BadRequest(ReddwarfError):
class BadRequest(TroveError):
message = _("The server could not comply with the request since it is "
"either malformed or otherwise incorrect.")
@ -136,12 +136,12 @@ class UserAlreadyExists(BadRequest):
message = _('A user with the name "%(name)s" already exists.')
class UnprocessableEntity(ReddwarfError):
class UnprocessableEntity(TroveError):
message = _("Unable to process the contained request")
class CannotResizeToSameSize(ReddwarfError):
class CannotResizeToSameSize(TroveError):
message = _("When resizing, instances must change size!")
@ -152,7 +152,7 @@ class VolumeAttachmentsNotFound(NotFound):
"instance %(server_id)")
class VolumeCreationFailure(ReddwarfError):
class VolumeCreationFailure(TroveError):
message = _("Failed to create a volume in Nova.")
@ -167,38 +167,38 @@ class LocalStorageNotSpecified(BadRequest):
message = _("Local storage not specified in flavor ID: %(flavor)s.")
class LocalStorageNotSupported(ReddwarfError):
class LocalStorageNotSupported(TroveError):
message = _("Local storage support is not enabled.")
class VolumeNotSupported(ReddwarfError):
class VolumeNotSupported(TroveError):
message = _("Volume support is not enabled.")
class TaskManagerError(ReddwarfError):
class TaskManagerError(TroveError):
message = _("An error occurred communicating with the task manager: "
"%(original_message)s.")
class BadValue(ReddwarfError):
class BadValue(TroveError):
message = _("Value could not be converted: %(msg)s")
class PollTimeOut(ReddwarfError):
class PollTimeOut(TroveError):
message = _("Polling request timed out.")
class Forbidden(ReddwarfError):
class Forbidden(TroveError):
message = _("User does not have admin privileges.")
class InvalidModelError(ReddwarfError):
class InvalidModelError(TroveError):
message = _("The following values are invalid: %(errors)s")
@ -208,7 +208,7 @@ class ModelNotFoundError(NotFound):
message = _("Not Found")
class UpdateGuestError(ReddwarfError):
class UpdateGuestError(TroveError):
message = _("Failed to update instances")
@ -235,43 +235,43 @@ class QuotaResourceUnknown(QuotaNotFound):
message = _("Unknown quota resources %(unknown)s.")
class BackupUploadError(ReddwarfError):
class BackupUploadError(TroveError):
message = _("Unable to upload Backup onto swift")
class BackupDownloadError(ReddwarfError):
class BackupDownloadError(TroveError):
message = _("Unable to download Backup from swift")
class BackupCreationError(ReddwarfError):
class BackupCreationError(TroveError):
message = _("Unable to create Backup")
class BackupUpdateError(ReddwarfError):
class BackupUpdateError(TroveError):
message = _("Unable to update Backup table in db")
class SecurityGroupCreationError(ReddwarfError):
class SecurityGroupCreationError(TroveError):
message = _("Failed to create Security Group.")
class SecurityGroupDeletionError(ReddwarfError):
class SecurityGroupDeletionError(TroveError):
message = _("Failed to delete Security Group.")
class SecurityGroupRuleCreationError(ReddwarfError):
class SecurityGroupRuleCreationError(TroveError):
message = _("Failed to create Security Group Rule.")
class SecurityGroupRuleDeletionError(ReddwarfError):
class SecurityGroupRuleDeletionError(TroveError):
message = _("Failed to delete Security Group Rule.")
class BackupNotCompleteError(ReddwarfError):
class BackupNotCompleteError(TroveError):
message = _("Unable to create instance because backup %(backup_id)s is "
"not completed")
@ -282,6 +282,6 @@ class BackupFileNotFound(NotFound):
"storage.")
class SwiftAuthError(ReddwarfError):
class SwiftAuthError(TroveError):
message = _("Swift account not accessible for tenant %(tenant_id)s.")

View File

@ -17,12 +17,12 @@
import routes
import webob.dec
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
from reddwarf.openstack.common import extensions
from reddwarf.openstack.common.gettextutils import _
from reddwarf.common import cfg
from reddwarf.common import wsgi
from trove.openstack.common import extensions
from trove.openstack.common.gettextutils import _
from trove.common import cfg
from trove.common import wsgi
LOG = logging.getLogger(__name__)
@ -32,7 +32,7 @@ ResourceExtension = extensions.ResourceExtension
CONF = cfg.CONF
class ReddwarfExtensionMiddleware(extensions.ExtensionMiddleware):
class TroveExtensionMiddleware(extensions.ExtensionMiddleware):
def __init__(self, application, ext_mgr=None):
ext_mgr = (ext_mgr or
@ -87,7 +87,7 @@ class ReddwarfExtensionMiddleware(extensions.ExtensionMiddleware):
def factory(global_config, **local_config):
"""Paste factory."""
def _factory(app):
extensions.DEFAULT_XMLNS = "http://docs.openstack.org/reddwarf"
extensions.DEFAULT_XMLNS = "http://docs.openstack.org/trove"
ext_mgr = extensions.ExtensionManager(CONF.api_extensions_path)
return ReddwarfExtensionMiddleware(app, ext_mgr)
return TroveExtensionMiddleware(app, ext_mgr)
return _factory

View File

@ -26,12 +26,12 @@ import time
import webob.dec
import webob.exc
from reddwarf.common import cfg
from reddwarf.common import wsgi as base_wsgi
from reddwarf.openstack.common import importutils
from reddwarf.openstack.common import jsonutils
from reddwarf.openstack.common import wsgi
from reddwarf.openstack.common.gettextutils import _
from trove.common import cfg
from trove.common import wsgi as base_wsgi
from trove.openstack.common import importutils
from trove.openstack.common import jsonutils
from trove.openstack.common import wsgi
from trove.openstack.common.gettextutils import _
CONF = cfg.CONF
@ -155,7 +155,7 @@ DEFAULT_LIMITS = [
]
class RateLimitingMiddleware(base_wsgi.ReddwarfMiddleware):
class RateLimitingMiddleware(base_wsgi.TroveMiddleware):
"""
Rate-limits requests passing through this middleware. All limit information
is stored in memory for this implementation.
@ -211,7 +211,7 @@ class RateLimitingMiddleware(base_wsgi.ReddwarfMiddleware):
retry = time.time() + delay
return base_wsgi.OverLimitFault(msg, error, retry)
req.environ["reddwarf.limits"] = self._limiter.get_limits(tenant_id)
req.environ["trove.limits"] = self._limiter.get_limits(tenant_id)
return self.application

View File

@ -12,11 +12,11 @@
# License for the specific language governing permissions and limitations
# under the License.
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
from reddwarf.openstack.common import rpc
from reddwarf.common import cfg
from reddwarf.common import exception
from trove.openstack.common import rpc
from trove.common import cfg
from trove.common import exception
CONF = cfg.CONF

View File

@ -17,8 +17,8 @@
"""Model classes that form the core of instances functionality."""
from reddwarf.openstack.common import log as logging
from reddwarf.common import remote
from trove.openstack.common import log as logging
from trove.common import remote
LOG = logging.getLogger(__name__)

View File

@ -15,27 +15,27 @@
# License for the specific language governing permissions and limitations
# under the License.
from reddwarf.common import cfg
from reddwarf.openstack.common.importutils import import_class
from trove.common import cfg
from trove.openstack.common.importutils import import_class
from novaclient.v1_1.client import Client
from swiftclient.client import Connection
CONF = cfg.CONF
COMPUTE_URL = CONF.nova_compute_url
PROXY_AUTH_URL = CONF.reddwarf_auth_url
PROXY_AUTH_URL = CONF.trove_auth_url
VOLUME_URL = CONF.nova_volume_url
OBJECT_STORE_URL = CONF.swift_url
USE_SNET = CONF.backup_use_snet
def dns_client(context):
from reddwarf.dns.manager import DnsManager
from trove.dns.manager import DnsManager
return DnsManager()
def guest_client(context, id):
from reddwarf.guestagent.api import API
from trove.guestagent.api import API
return API(context, id)
@ -50,8 +50,8 @@ def nova_client(context):
def create_admin_nova_client(context):
"""
Creates client that uses reddwarf admin credentials
:return: a client for nova for the reddwarf admin
Creates client that uses trove admin credentials
:return: a client for nova for the trove admin
"""
client = create_nova_client(context)
client.client.auth_token = None

View File

@ -21,17 +21,17 @@ import inspect
import os
import kombu
from reddwarf.openstack.common import importutils
from reddwarf.openstack.common import loopingcall
from reddwarf.openstack.common import rpc as openstack_rpc
from reddwarf.openstack.common.rpc import service as rpc_service
from reddwarf.common import cfg
from trove.openstack.common import importutils
from trove.openstack.common import loopingcall
from trove.openstack.common import rpc as openstack_rpc
from trove.openstack.common.rpc import service as rpc_service
from trove.common import cfg
CONF = cfg.CONF
def delete_queue(context, topic):
if CONF.rpc_backend == "reddwarf.openstack.common.rpc.impl_kombu":
if CONF.rpc_backend == "trove.openstack.common.rpc.impl_kombu":
connection = openstack_rpc.create_connection()
channel = connection.channel
durable = connection.conf.rabbit_durable_queues
@ -46,7 +46,7 @@ class RpcService(rpc_service.Service):
def __init__(self, host=None, binary=None, topic=None, manager=None):
host = host or CONF.host
binary = binary or os.path.basename(inspect.stack()[-1][1])
topic = topic or binary.rpartition('reddwarf-')[2]
topic = topic or binary.rpartition('trove-')[2]
self.manager_impl = importutils.import_object(manager)
self.report_interval = CONF.report_interval
super(RpcService, self).__init__(host, topic,

View File

@ -33,13 +33,13 @@ from eventlet import semaphore
from eventlet.green import subprocess
from eventlet.timeout import Timeout
from reddwarf.common import exception
from reddwarf.openstack.common import importutils
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common import processutils
from reddwarf.openstack.common import timeutils
from reddwarf.openstack.common import utils as openstack_utils
from reddwarf.openstack.common.gettextutils import _
from trove.common import exception
from trove.openstack.common import importutils
from trove.openstack.common import log as logging
from trove.openstack.common import processutils
from trove.openstack.common import timeutils
from trove.openstack.common import utils as openstack_utils
from trove.openstack.common.gettextutils import _
LOG = logging.getLogger(__name__)
import_class = importutils.import_class

View File

@ -16,7 +16,7 @@
# under the License.
from reddwarf.common import wsgi
from trove.common import wsgi
def create_links(resource_path, request, id):

View File

@ -14,7 +14,7 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Wsgi helper utilities for reddwarf"""
"""Wsgi helper utilities for trove"""
import eventlet.wsgi
import math
@ -30,19 +30,20 @@ from lxml import etree
from paste import deploy
from xml.dom import minidom
from reddwarf.common import context as rd_context
from reddwarf.common import exception
from reddwarf.common import utils
from reddwarf.openstack.common.gettextutils import _
from reddwarf.openstack.common import jsonutils
from trove.common import context as rd_context
from trove.common import exception
from trove.common import utils
from trove.openstack.common.gettextutils import _
from trove.openstack.common import jsonutils
from reddwarf.openstack.common import pastedeploy
from reddwarf.openstack.common import service
from reddwarf.openstack.common import wsgi as openstack_wsgi
from reddwarf.openstack.common import log as logging
from reddwarf.common import cfg
from trove.openstack.common import pastedeploy
from trove.openstack.common import service
from trove.openstack.common import wsgi as openstack_wsgi
from trove.openstack.common import log as logging
from trove.common import cfg
CONTEXT_KEY = 'reddwarf.context'
CONTEXT_KEY = 'trove.context'
Router = openstack_wsgi.Router
Debug = openstack_wsgi.Debug
Middleware = openstack_wsgi.Middleware
JSONDictSerializer = openstack_wsgi.JSONDictSerializer
@ -52,7 +53,7 @@ RequestDeserializer = openstack_wsgi.RequestDeserializer
eventlet.patcher.monkey_patch(all=False, socket=True)
LOG = logging.getLogger('reddwarf.common.wsgi')
LOG = logging.getLogger('trove.common.wsgi')
CONF = cfg.CONF
@ -158,7 +159,7 @@ def serializers(**serializers):
return decorator
class ReddwarfMiddleware(Middleware):
class TroveMiddleware(Middleware):
# Note: taken from nova
@classmethod
@ -246,8 +247,8 @@ class Request(openstack_wsgi.Request):
return 'application/{0}'.format(parts[1])
ctypes = {
'application/vnd.openstack.reddwarf+json': "application/json",
'application/vnd.openstack.reddwarf+xml': "application/xml",
'application/vnd.openstack.trove+json': "application/json",
'application/vnd.openstack.trove+xml': "application/xml",
'application/json': "application/json",
'application/xml': "application/xml",
}
@ -258,7 +259,7 @@ class Request(openstack_wsgi.Request):
@utils.cached_property
def accept_version(self):
accept_header = self.headers.get('ACCEPT', "")
accept_version_re = re.compile(".*?application/vnd.openstack.reddwarf"
accept_version_re = re.compile(".*?application/vnd.openstack.trove"
"(\+.+?)?;"
"version=(?P<version_no>\d+\.?\d*)")
@ -275,7 +276,7 @@ class Request(openstack_wsgi.Request):
class Result(object):
"""A result whose serialization is compatable with JSON and XML.
This class is used by ReddwarfResponseSerializer, which calls the
This class is used by TroveResponseSerializer, which calls the
data method to grab a JSON or XML specific dictionary which it then
passes on to be serialized.
@ -325,12 +326,12 @@ class Resource(openstack_wsgi.Resource):
result = Result(result)
return result
except exception.ReddwarfError as reddwarf_error:
except exception.TroveError as trove_error:
LOG.debug(traceback.format_exc())
LOG.debug("Caught Reddwarf Error %s", reddwarf_error)
httpError = self._get_http_error(reddwarf_error)
LOG.debug("Caught Trove Error %s", trove_error)
httpError = self._get_http_error(trove_error)
LOG.debug("Mapped Error to %s", httpError)
return Fault(httpError(str(reddwarf_error), request=request))
return Fault(httpError(str(trove_error), request=request))
except webob.exc.HTTPError as http_error:
LOG.debug(traceback.format_exc())
return Fault(http_error)
@ -428,11 +429,11 @@ class Controller(object):
}
def create_resource(self):
serializer = ReddwarfResponseSerializer(
body_serializers={'application/xml': ReddwarfXMLDictSerializer()})
serializer = TroveResponseSerializer(
body_serializers={'application/xml': TroveXMLDictSerializer()})
return Resource(
self,
ReddwarfRequestDeserializer(),
TroveRequestDeserializer(),
serializer,
self.exception_map)
@ -447,20 +448,20 @@ class Controller(object):
*self.exclude_attr))
class ReddwarfRequestDeserializer(RequestDeserializer):
class TroveRequestDeserializer(RequestDeserializer):
"""Break up a Request object into more useful pieces."""
def __init__(self, body_deserializers=None, headers_deserializer=None,
supported_content_types=None):
super(ReddwarfRequestDeserializer, self).__init__(
super(TroveRequestDeserializer, self).__init__(
body_deserializers,
headers_deserializer,
supported_content_types)
self.body_deserializers['application/xml'] = ReddwarfXMLDeserializer()
self.body_deserializers['application/xml'] = TroveXMLDeserializer()
class ReddwarfXMLDeserializer(XMLDeserializer):
class TroveXMLDeserializer(XMLDeserializer):
def __init__(self, metadata=None):
"""
@ -470,7 +471,7 @@ class ReddwarfXMLDeserializer(XMLDeserializer):
if metadata is None:
metadata = {}
metadata['plurals'] = CUSTOM_PLURALS_METADATA
super(ReddwarfXMLDeserializer, self).__init__(metadata)
super(TroveXMLDeserializer, self).__init__(metadata)
def default(self, datastring):
# Sanitize the newlines
@ -480,10 +481,10 @@ class ReddwarfXMLDeserializer(XMLDeserializer):
'', datastring))}
class ReddwarfXMLDictSerializer(openstack_wsgi.XMLDictSerializer):
class TroveXMLDictSerializer(openstack_wsgi.XMLDictSerializer):
def __init__(self, metadata=None, xmlns=None):
super(ReddwarfXMLDictSerializer, self).__init__(metadata, XMLNS)
super(TroveXMLDictSerializer, self).__init__(metadata, XMLNS)
def default(self, data):
# We expect data to be a dictionary containing a single key as the XML
@ -517,14 +518,14 @@ class ReddwarfXMLDictSerializer(openstack_wsgi.XMLDictSerializer):
metadata['attributes'] = CUSTOM_SERIALIZER_METADATA
if hasattr(data, "to_xml"):
return data.to_xml()
return super(ReddwarfXMLDictSerializer, self)._to_xml_node(
return super(TroveXMLDictSerializer, self)._to_xml_node(
doc,
metadata,
nodename,
data)
class ReddwarfResponseSerializer(openstack_wsgi.ResponseSerializer):
class TroveResponseSerializer(openstack_wsgi.ResponseSerializer):
def serialize_body(self, response, data, content_type, action):
"""Overrides body serialization in openstack_wsgi.ResponseSerializer.
@ -536,14 +537,14 @@ class ReddwarfResponseSerializer(openstack_wsgi.ResponseSerializer):
"""
if isinstance(data, Result):
data = data.data(content_type)
super(ReddwarfResponseSerializer, self).serialize_body(
super(TroveResponseSerializer, self).serialize_body(
response,
data,
content_type,
action)
def serialize_headers(self, response, data, action):
super(ReddwarfResponseSerializer, self).serialize_headers(
super(TroveResponseSerializer, self).serialize_headers(
response,
data,
action)
@ -642,12 +643,12 @@ class ContextMiddleware(openstack_wsgi.Middleware):
is_admin = True
break
limits = self._extract_limits(request.params)
context = rd_context.ReddwarfContext(auth_token=auth_token,
tenant=tenant_id,
user=user,
is_admin=is_admin,
limit=limits.get('limit'),
marker=limits.get('marker'))
context = rd_context.TroveContext(auth_token=auth_token,
tenant=tenant_id,
user=user,
is_admin=is_admin,
limit=limits.get('limit'),
marker=limits.get('marker'))
request.environ[CONTEXT_KEY] = context
@classmethod

View File

@ -17,8 +17,8 @@
import optparse
from reddwarf.common import utils
from reddwarf.common import cfg
from trove.common import utils
from trove.common import cfg
CONF = cfg.CONF
@ -95,7 +95,7 @@ def add_options(parser):
"""
help_text = ("The following configuration options are specific to the "
"Reddwarf database.")
"Trove database.")
group = optparse.OptionGroup(
parser,

View File

@ -12,14 +12,14 @@
# License for the specific language governing permissions and limitations
# under the License.
from reddwarf.db import get_db_api
from reddwarf.db import db_query
from reddwarf.common import exception
from reddwarf.common import models
from reddwarf.common import pagination
from reddwarf.common import utils
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common.gettextutils import _
from trove.db import get_db_api
from trove.db import db_query
from trove.common import exception
from trove.common import models
from trove.common import pagination
from trove.common import utils
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
LOG = logging.getLogger(__name__)

View File

@ -20,11 +20,11 @@ from sqlalchemy import and_
from sqlalchemy import or_
from sqlalchemy.orm import aliased
from reddwarf.common import exception
from reddwarf.common import utils
from reddwarf.db.sqlalchemy import migration
from reddwarf.db.sqlalchemy import mappers
from reddwarf.db.sqlalchemy import session
from trove.common import exception
from trove.common import utils
from trove.db.sqlalchemy import migration
from trove.db.sqlalchemy import mappers
from trove.db.sqlalchemy import session
def list(query_func, *args, **kwargs):

View File

@ -1,7 +1,7 @@
[db_settings]
# Used to identify which repository this database is versioned under.
# You can use the name of your project.
repository_id=Reddwarf Migrations
repository_id=Trove Migrations
# The name of the database table used to track the schema version.
# This name shouldn't already be used by your project.

View File

@ -17,11 +17,11 @@
"""Various conveniences used for migration scripts."""
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
import sqlalchemy.types
logger = logging.getLogger('reddwarf.db.sqlalchemy.migrate_repo.schema')
logger = logging.getLogger('trove.db.sqlalchemy.migrate_repo.schema')
String = lambda length: sqlalchemy.types.String(

View File

@ -20,14 +20,14 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import BigInteger
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import BigInteger
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -20,14 +20,14 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import BigInteger
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import BigInteger
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -20,14 +20,14 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import BigInteger
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import BigInteger
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -20,11 +20,11 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -20,14 +20,14 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import BigInteger
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import BigInteger
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -20,10 +20,10 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import String
meta = MetaData()

View File

@ -15,9 +15,9 @@
from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
def upgrade(migrate_engine):

View File

@ -16,9 +16,9 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import ColumnDefault
from sqlalchemy.schema import MetaData
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
def upgrade(migrate_engine):

View File

@ -15,9 +15,9 @@
from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import Table
def upgrade(migrate_engine):

View File

@ -20,12 +20,12 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -16,12 +16,12 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -16,13 +16,13 @@ from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from sqlalchemy.schema import UniqueConstraint
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Float
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Float
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
meta = MetaData()

View File

@ -19,13 +19,13 @@ from sqlalchemy import ForeignKey
from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from reddwarf.db.sqlalchemy.migrate_repo.schema import create_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import drop_tables
from reddwarf.db.sqlalchemy.migrate_repo.schema import Boolean
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import DateTime
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import create_tables
from trove.db.sqlalchemy.migrate_repo.schema import drop_tables
from trove.db.sqlalchemy.migrate_repo.schema import Boolean
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import DateTime
from trove.db.sqlalchemy.migrate_repo.schema import Table
meta = MetaData()

View File

@ -15,9 +15,9 @@
from sqlalchemy.schema import Column
from sqlalchemy.schema import MetaData
from reddwarf.db.sqlalchemy.migrate_repo.schema import Integer
from reddwarf.db.sqlalchemy.migrate_repo.schema import String
from reddwarf.db.sqlalchemy.migrate_repo.schema import Table
from trove.db.sqlalchemy.migrate_repo.schema import Integer
from trove.db.sqlalchemy.migrate_repo.schema import String
from trove.db.sqlalchemy.migrate_repo.schema import Table
def upgrade(migrate_engine):

View File

@ -15,7 +15,7 @@
# License for the specific language governing permissions and limitations
# under the License.
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
import os
from migrate.versioning import api as versioning_api
@ -26,10 +26,10 @@ try:
except ImportError:
from migrate import exceptions as versioning_exceptions
from reddwarf.common import exception
from trove.common import exception
logger = logging.getLogger('reddwarf.db.sqlalchemy.migration')
logger = logging.getLogger('trove.db.sqlalchemy.migration')
def db_version(options, repo_path=None):

View File

@ -20,10 +20,10 @@ from sqlalchemy import create_engine
from sqlalchemy import MetaData
from sqlalchemy.orm import sessionmaker
from reddwarf.common import cfg
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common.gettextutils import _
from reddwarf.db.sqlalchemy import mappers
from trove.common import cfg
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
from trove.db.sqlalchemy import mappers
_ENGINE = None
_MAKER = None
@ -41,13 +41,13 @@ def configure_db(options, models_mapper=None):
if models_mapper:
models_mapper.map(_ENGINE)
else:
from reddwarf.instance import models as base_models
from reddwarf.dns import models as dns_models
from reddwarf.extensions.mysql import models as mysql_models
from reddwarf.guestagent import models as agent_models
from reddwarf.quota import models as quota_models
from reddwarf.backup import models as backup_models
from reddwarf.extensions.security_group import models as secgrp_models
from trove.instance import models as base_models
from trove.dns import models as dns_models
from trove.extensions.mysql import models as mysql_models
from trove.guestagent import models as agent_models
from trove.quota import models as quota_models
from trove.backup import models as backup_models
from trove.extensions.security_group import models as secgrp_models
model_modules = [
base_models,

View File

@ -18,10 +18,10 @@
"""
Dns manager.
"""
from reddwarf.openstack.common import log as logging
from trove.openstack.common import log as logging
from reddwarf.common import utils
from reddwarf.common import cfg
from trove.common import utils
from trove.common import cfg
LOG = logging.getLogger(__name__)
@ -46,7 +46,7 @@ class DnsManager(object):
def create_instance_entry(self, instance_id, content):
"""Connects a new instance with a DNS entry.
:param instance_id: The reddwarf instance_id to associate.
:param instance_id: The trove instance_id to associate.
:param content: The IP content attached to the instance.
"""
@ -61,7 +61,7 @@ class DnsManager(object):
def delete_instance_entry(self, instance_id, content=None):
"""Removes a DNS entry associated to an instance.
:param instance_id: The reddwarf instance id to associate.
:param instance_id: The trove instance id to associate.
:param content: The IP content attached to the instance.
"""

View File

@ -20,11 +20,11 @@ Model classes that map instance Ip to dns record.
"""
from reddwarf.db import get_db_api
from reddwarf.common import exception
from reddwarf.common.models import ModelBase
from reddwarf.openstack.common import log as logging
from reddwarf.openstack.common.gettextutils import _
from trove.db import get_db_api
from trove.common import exception
from trove.common.models import ModelBase
from trove.openstack.common import log as logging
from trove.openstack.common.gettextutils import _
LOG = logging.getLogger(__name__)

View File

@ -23,15 +23,15 @@ __version__ = '2.4'
import hashlib
from reddwarf.openstack.common import log as logging
from reddwarf.common import cfg
from reddwarf.common import exception
from reddwarf.common.exception import NotFound
from reddwarf.dns.models import DnsRecord
from trove.openstack.common import log as logging
from trove.common import cfg
from trove.common import exception
from trove.common.exception import NotFound
from trove.dns.models import DnsRecord
from rsdns.client import DNSaas
from rsdns.client.future import RsDnsError
from reddwarf.dns.driver import DnsEntry
from trove.dns.driver import DnsEntry
CONF = cfg.CONF

Some files were not shown because too many files have changed in this diff Show More