From 7ab80b554dde5f1f1e61b6a8c45492c5ac27ed6b Mon Sep 17 00:00:00 2001 From: Michael Basnight Date: Wed, 19 Jun 2013 13:44:44 -0700 Subject: [PATCH] Rename from reddwarf to trove. Implements Blueprint reddwarf-trove-rename Change-Id: Ia9ee609bbc06a1d8b9d6917642529f30347541fd --- .coveragerc | 4 +- .gitignore | 9 +- .testr.conf | 2 +- MANIFEST.in | 8 +- bin/start_server.sh | 10 +- bin/{reddwarf-api => trove-api} | 18 +-- ...-api-os-database => trove-api-os-database} | 16 +-- bin/{reddwarf-cli => trove-cli} | 6 +- bin/{reddwarf-guestagent => trove-guestagent} | 18 +-- bin/{reddwarf-manage => trove-manage} | 24 ++-- ...gmt-taskmanager => trove-mgmt-taskmanager} | 16 +-- bin/{reddwarf-server => trove-server} | 18 +-- ...reddwarf-taskmanager => trove-taskmanager} | 16 +-- development/FunkyBugs.txt | 68 --------- development/bootstrap/bootstrap.sh | 49 ------- development/bootstrap/bootstrap_init.sh | 9 -- development/deprecated-bootstrap.sh | 44 ------ development/development_enviroment.sh | 121 ---------------- development/instance_source.sh | 33 ----- etc/nova/nova.conf.template | 68 --------- etc/nova/reddwarf-api-paste.ini | 133 ------------------ etc/reddwarf/api-paste.ini | 41 ------ etc/reddwarf/api-paste.ini.test | 45 ------ etc/tests/core.test.conf | 22 +-- etc/tests/localhost.test.conf | 18 +-- etc/tests/xml.localhost.test.conf | 2 +- etc/trove/api-paste.ini | 41 ++++++ etc/trove/api-paste.ini.test | 45 ++++++ etc/{reddwarf => trove}/conf.d/README | 0 etc/{reddwarf => trove}/conf.d/guest_info | 0 .../trove-guestagent.conf.sample} | 20 +-- .../trove-taskmanager.conf.sample} | 26 ++-- .../trove.conf.sample} | 36 ++--- .../trove.conf.test} | 60 ++++---- openstack-common.conf | 2 +- reddwarf/README | 1 - rsdns/client/dns_client.py | 2 +- run_tests.py | 74 +++++----- run_tests.sh | 4 +- setup.cfg | 12 +- tools/install_venv.py | 14 +- trove/README | 1 + {reddwarf => trove}/__init__.py | 4 +- {reddwarf => trove}/backup/__init__.py | 0 {reddwarf => trove}/backup/models.py | 18 +-- {reddwarf => trove}/backup/service.py | 16 +-- {reddwarf => trove}/backup/views.py | 0 {reddwarf => trove}/common/__init__.py | 0 {reddwarf => trove}/common/api.py | 12 +- {reddwarf => trove}/common/auth.py | 14 +- {reddwarf => trove}/common/cfg.py | 50 +++---- {reddwarf => trove}/common/context.py | 12 +- {reddwarf => trove}/common/exception.py | 74 +++++----- {reddwarf => trove}/common/extensions.py | 16 +-- {reddwarf => trove}/common/limits.py | 16 +-- {reddwarf => trove}/common/manager.py | 8 +- {reddwarf => trove}/common/models.py | 4 +- {reddwarf => trove}/common/pagination.py | 0 {reddwarf => trove}/common/remote.py | 14 +- {reddwarf => trove}/common/rpc.py | 14 +- .../common/schemas/atom-link.rng | 0 {reddwarf => trove}/common/schemas/atom.rng | 0 .../common/schemas/v1.1/limits.rng | 0 {reddwarf => trove}/common/utils.py | 14 +- {reddwarf => trove}/common/views.py | 2 +- {reddwarf => trove}/common/wsgi.py | 85 +++++------ {reddwarf => trove}/db/__init__.py | 6 +- {reddwarf => trove}/db/models.py | 16 +-- {reddwarf => trove}/db/sqlalchemy/__init__.py | 0 {reddwarf => trove}/db/sqlalchemy/api.py | 10 +- {reddwarf => trove}/db/sqlalchemy/mappers.py | 0 .../db/sqlalchemy/migrate_repo/README | 0 .../db/sqlalchemy/migrate_repo/__init__.py | 0 .../db/sqlalchemy/migrate_repo/manage.py | 0 .../db/sqlalchemy/migrate_repo/migrate.cfg | 2 +- .../db/sqlalchemy/migrate_repo/schema.py | 4 +- .../migrate_repo/versions/001_base_schema.py | 16 +-- .../versions/002_service_images.py | 16 +-- .../versions/003_service_statuses.py | 16 +-- .../migrate_repo/versions/004_root_enabled.py | 10 +- .../migrate_repo/versions/005_heartbeat.py | 16 +-- .../migrate_repo/versions/006_dns_records.py | 8 +- .../versions/007_add_volume_flavor.py | 6 +- .../versions/008_add_instance_fields.py | 6 +- .../009_add_deleted_flag_to_instances.py | 6 +- .../migrate_repo/versions/010_add_usage.py | 12 +- .../migrate_repo/versions/011_quota.py | 12 +- .../migrate_repo/versions/012_backup.py | 14 +- .../013_add_security_group_artifacts.py | 14 +- .../versions/014_update_instance_flavor_id.py | 6 +- .../migrate_repo/versions/__init__.py | 0 .../db/sqlalchemy/migration.py | 6 +- {reddwarf => trove}/db/sqlalchemy/session.py | 22 +-- {reddwarf => trove}/dns/__init__.py | 0 {reddwarf => trove}/dns/driver.py | 0 {reddwarf => trove}/dns/manager.py | 10 +- {reddwarf => trove}/dns/models.py | 10 +- {reddwarf => trove}/dns/rsdns/__init__.py | 0 {reddwarf => trove}/dns/rsdns/driver.py | 12 +- {reddwarf => trove}/extensions/__init__.py | 0 {reddwarf => trove}/extensions/account.py | 12 +- .../extensions/account/__init__.py | 0 .../extensions/account/models.py | 10 +- .../extensions/account/service.py | 18 +-- .../extensions/account/views.py | 0 {reddwarf => trove}/extensions/mgmt.py | 22 +-- .../extensions/mgmt/__init__.py | 0 .../extensions/mgmt/host/__init__.py | 0 .../extensions/mgmt/host/instance/__init__.py | 0 .../extensions/mgmt/host/instance/service.py | 10 +- .../extensions/mgmt/host/models.py | 24 ++-- .../extensions/mgmt/host/service.py | 18 +-- .../extensions/mgmt/host/views.py | 0 .../extensions/mgmt/instances/__init__.py | 0 .../extensions/mgmt/instances/models.py | 20 +-- .../extensions/mgmt/instances/service.py | 26 ++-- .../extensions/mgmt/instances/views.py | 2 +- .../extensions/mgmt/quota/__init__.py | 0 .../extensions/mgmt/quota/service.py | 14 +- .../extensions/mgmt/quota/views.py | 0 .../extensions/mgmt/volume/__init__.py | 0 .../extensions/mgmt/volume/models.py | 4 +- .../extensions/mgmt/volume/service.py | 14 +- .../extensions/mgmt/volume/views.py | 0 {reddwarf => trove}/extensions/mysql.py | 20 +-- .../extensions/mysql/__init__.py | 0 .../extensions/mysql/common.py | 4 +- .../extensions/mysql/models.py | 18 +-- .../extensions/mysql/service.py | 22 +-- {reddwarf => trove}/extensions/mysql/views.py | 0 .../extensions/security_group.py | 20 +-- .../extensions/security_group/__init__.py | 0 .../extensions/security_group/models.py | 32 ++--- .../extensions/security_group/service.py | 20 +-- .../extensions/security_group/views.py | 2 +- {reddwarf => trove}/flavor/__init__.py | 0 {reddwarf => trove}/flavor/models.py | 12 +- {reddwarf => trove}/flavor/service.py | 10 +- {reddwarf => trove}/flavor/views.py | 6 +- {reddwarf => trove}/guestagent/__init__.py | 0 {reddwarf => trove}/guestagent/api.py | 16 +-- .../guestagent/backup/__init__.py | 2 +- .../guestagent/backup/backupagent.py | 20 +-- {reddwarf => trove}/guestagent/db/__init__.py | 0 {reddwarf => trove}/guestagent/db/models.py | 2 +- {reddwarf => trove}/guestagent/dbaas.py | 8 +- .../guestagent/manager/__init__.py | 0 .../guestagent/manager/mysql.py | 22 +-- .../guestagent/manager/mysql_service.py | 20 +-- {reddwarf => trove}/guestagent/models.py | 14 +- {reddwarf => trove}/guestagent/pkg.py | 18 +-- {reddwarf => trove}/guestagent/query.py | 0 {reddwarf => trove}/guestagent/service.py | 4 +- .../guestagent/strategies/__init__.py | 0 .../guestagent/strategies/backup/__init__.py | 4 +- .../guestagent/strategies/backup/base.py | 8 +- .../guestagent/strategies/backup/impl.py | 4 +- .../guestagent/strategies/restore/__init__.py | 4 +- .../guestagent/strategies/restore/base.py | 12 +- .../guestagent/strategies/restore/impl.py | 8 +- .../guestagent/strategies/storage/__init__.py | 4 +- .../guestagent/strategies/storage/base.py | 6 +- .../guestagent/strategies/storage/swift.py | 8 +- {reddwarf => trove}/guestagent/strategy.py | 4 +- {reddwarf => trove}/guestagent/volume.py | 10 +- {reddwarf => trove}/instance/__init__.py | 0 {reddwarf => trove}/instance/models.py | 50 +++---- {reddwarf => trove}/instance/service.py | 36 ++--- {reddwarf => trove}/instance/tasks.py | 2 +- {reddwarf => trove}/instance/views.py | 16 +-- {reddwarf => trove}/limits/__init__.py | 0 {reddwarf => trove}/limits/service.py | 8 +- {reddwarf => trove}/limits/views.py | 2 +- {reddwarf => trove}/openstack/__init__.py | 0 {reddwarf => trove}/openstack/common/README | 0 .../openstack/common/__init__.py | 0 .../openstack/common/config.py | 0 .../openstack/common/context.py | 2 +- .../openstack/common/eventlet_backdoor.py | 0 .../openstack/common/exception.py | 2 +- .../openstack/common/excutils.py | 2 +- .../openstack/common/extensions.py | 4 +- .../openstack/common/fileutils.py | 0 .../openstack/common/gettextutils.py | 6 +- .../openstack/common/importutils.py | 0 .../openstack/common/iniparser.py | 0 .../openstack/common/jsonutils.py | 2 +- {reddwarf => trove}/openstack/common/local.py | 0 .../openstack/common/lockutils.py | 6 +- {reddwarf => trove}/openstack/common/log.py | 10 +- .../openstack/common/loopingcall.py | 6 +- .../openstack/common/middleware/__init__.py | 0 .../openstack/common/middleware/context.py | 6 +- .../openstack/common/network_utils.py | 2 +- .../openstack/common/notifier/__init__.py | 0 .../openstack/common/notifier/api.py | 12 +- .../openstack/common/notifier/log_notifier.py | 6 +- .../common/notifier/no_op_notifier.py | 0 .../common/notifier/rabbit_notifier.py | 6 +- .../openstack/common/notifier/rpc_notifier.py | 8 +- .../common/notifier/rpc_notifier2.py | 8 +- .../common/notifier/test_notifier.py | 0 .../openstack/common/pastedeploy.py | 2 +- .../openstack/common/periodic_task.py | 4 +- .../openstack/common/policy.py | 4 +- .../openstack/common/processutils.py | 4 +- .../openstack/common/rpc/__init__.py | 10 +- .../openstack/common/rpc/amqp.py | 10 +- .../openstack/common/rpc/common.py | 10 +- .../openstack/common/rpc/dispatcher.py | 2 +- .../openstack/common/rpc/impl_fake.py | 2 +- .../openstack/common/rpc/impl_kombu.py | 8 +- .../openstack/common/rpc/impl_qpid.py | 12 +- .../openstack/common/rpc/impl_zmq.py | 14 +- .../openstack/common/rpc/matchmaker.py | 4 +- .../openstack/common/rpc/matchmaker_redis.py | 6 +- .../openstack/common/rpc/proxy.py | 2 +- .../openstack/common/rpc/service.py | 10 +- .../openstack/common/rpc/zmq_receiver.py | 6 +- .../openstack/common/service.py | 12 +- .../openstack/common/sslutils.py | 2 +- .../openstack/common/testutils.py | 0 .../openstack/common/threadgroup.py | 4 +- .../openstack/common/timeutils.py | 0 {reddwarf => trove}/openstack/common/utils.py | 0 .../openstack/common/uuidutils.py | 0 {reddwarf => trove}/openstack/common/wsgi.py | 14 +- .../openstack/common/xmlutils.py | 0 {reddwarf => trove}/quota/__init__.py | 0 {reddwarf => trove}/quota/models.py | 8 +- {reddwarf => trove}/quota/quota.py | 18 +-- {reddwarf => trove}/taskmanager/__init__.py | 0 {reddwarf => trove}/taskmanager/api.py | 10 +- {reddwarf => trove}/taskmanager/manager.py | 20 +-- {reddwarf => trove}/taskmanager/models.py | 80 +++++------ {reddwarf => trove}/taskmanager/service.py | 2 +- {reddwarf => trove}/tests/__init__.py | 0 {reddwarf => trove}/tests/api/__init__.py | 0 {reddwarf => trove}/tests/api/backups.py | 12 +- {reddwarf => trove}/tests/api/databases.py | 12 +- {reddwarf => trove}/tests/api/flavors.py | 22 +-- {reddwarf => trove}/tests/api/header.py | 10 +- {reddwarf => trove}/tests/api/instances.py | 60 ++++---- .../tests/api/instances_actions.py | 42 +++--- .../tests/api/instances_delete.py | 14 +- .../tests/api/instances_mysql_down.py | 14 +- .../tests/api/instances_resize.py | 20 +-- {reddwarf => trove}/tests/api/limits.py | 20 +-- .../tests/api/mgmt/__init__.py | 0 .../tests/api/mgmt/accounts.py | 20 +-- .../tests/api/mgmt/admin_required.py | 10 +- .../tests/api/mgmt/instances.py | 40 +++--- .../tests/api/mgmt/instances_actions.py | 20 +-- .../tests/api/mgmt/malformed_json.py | 14 +- {reddwarf => trove}/tests/api/mgmt/quotas.py | 32 ++--- {reddwarf => trove}/tests/api/mgmt/storage.py | 14 +- {reddwarf => trove}/tests/api/root.py | 16 +-- {reddwarf => trove}/tests/api/user_access.py | 12 +- {reddwarf => trove}/tests/api/users.py | 18 +-- {reddwarf => trove}/tests/api/versions.py | 14 +- {reddwarf => trove}/tests/config.py | 12 +- {reddwarf => trove}/tests/fakes/__init__.py | 0 {reddwarf => trove}/tests/fakes/common.py | 4 +- {reddwarf => trove}/tests/fakes/guestagent.py | 22 +-- {reddwarf => trove}/tests/fakes/keystone.py | 0 {reddwarf => trove}/tests/fakes/nova.py | 16 +-- {reddwarf => trove}/tests/fakes/swift.py | 0 .../tests/unittests/__init__.py | 0 .../tests/unittests/api/__init__.py | 0 .../tests/unittests/api/common/__init__.py | 0 .../tests/unittests/api/common/test_limits.py | 16 +-- .../tests/unittests/api/test_versions.py | 14 +- .../tests/unittests/backup/__init__.py | 0 .../unittests/backup/test_backup_models.py | 14 +- .../unittests/backup/test_backupagent.py | 26 ++-- .../tests/unittests/backup/test_storage.py | 0 .../tests/unittests/common/__init__.py | 0 .../tests/unittests/common/test_remote.py | 12 +- .../tests/unittests/guestagent/__init__.py | 0 .../tests/unittests/guestagent/test_api.py | 10 +- .../tests/unittests/guestagent/test_dbaas.py | 52 +++---- .../unittests/guestagent/test_dbmodels.py | 6 +- .../unittests/guestagent/test_manager.py | 16 +-- .../tests/unittests/guestagent/test_models.py | 8 +- .../tests/unittests/guestagent/test_pkg.py | 6 +- .../tests/unittests/guestagent/test_query.py | 2 +- .../unittests/guestagent/test_service.py | 2 +- .../tests/unittests/guestagent/test_volume.py | 4 +- .../tests/unittests/mgmt/__init__.py | 0 .../tests/unittests/mgmt/test_models.py | 32 ++--- .../tests/unittests/quota/__init__.py | 0 .../tests/unittests/quota/test_quota.py | 24 ++-- .../tests/unittests/secgroups/__init__.py | 0 .../secgroups/test_security_group.py | 14 +- .../tests/unittests/taskmanager/__init__.py | 0 .../unittests/taskmanager/test_models.py | 6 +- .../tests/unittests/util/__init__.py | 0 .../tests/unittests/util/matchers.py | 0 .../tests/unittests/util/util.py | 6 +- {reddwarf => trove}/tests/util/__init__.py | 56 ++++---- {reddwarf => trove}/tests/util/check.py | 0 {reddwarf => trove}/tests/util/client.py | 8 +- {reddwarf => trove}/tests/util/mysql.py | 4 +- .../tests/util/server_connection.py | 8 +- {reddwarf => trove}/tests/util/usage.py | 4 +- {reddwarf => trove}/tests/util/users.py | 2 +- {reddwarf => trove}/version.py | 2 +- {reddwarf => trove}/versions.py | 2 +- 308 files changed, 1573 insertions(+), 2098 deletions(-) rename bin/{reddwarf-api => trove-api} (73%) rename bin/{reddwarf-api-os-database => trove-api-os-database} (84%) rename bin/{reddwarf-cli => trove-cli} (97%) rename bin/{reddwarf-guestagent => trove-guestagent} (80%) rename bin/{reddwarf-manage => trove-manage} (87%) rename bin/{reddwarf-mgmt-taskmanager => trove-mgmt-taskmanager} (80%) rename bin/{reddwarf-server => trove-server} (81%) rename bin/{reddwarf-taskmanager => trove-taskmanager} (79%) delete mode 100644 development/FunkyBugs.txt delete mode 100755 development/bootstrap/bootstrap.sh delete mode 100644 development/bootstrap/bootstrap_init.sh delete mode 100644 development/deprecated-bootstrap.sh delete mode 100644 development/development_enviroment.sh delete mode 100644 development/instance_source.sh delete mode 100644 etc/nova/nova.conf.template delete mode 100644 etc/nova/reddwarf-api-paste.ini delete mode 100644 etc/reddwarf/api-paste.ini delete mode 100644 etc/reddwarf/api-paste.ini.test create mode 100644 etc/trove/api-paste.ini create mode 100644 etc/trove/api-paste.ini.test rename etc/{reddwarf => trove}/conf.d/README (100%) rename etc/{reddwarf => trove}/conf.d/guest_info (100%) rename etc/{reddwarf/reddwarf-guestagent.conf.sample => trove/trove-guestagent.conf.sample} (80%) rename etc/{reddwarf/reddwarf-taskmanager.conf.sample => trove/trove-taskmanager.conf.sample} (79%) rename etc/{reddwarf/reddwarf.conf.sample => trove/trove.conf.sample} (79%) rename etc/{reddwarf/reddwarf.conf.test => trove/trove.conf.test} (69%) delete mode 100644 reddwarf/README create mode 100644 trove/README rename {reddwarf => trove}/__init__.py (92%) rename {reddwarf => trove}/backup/__init__.py (100%) rename {reddwarf => trove}/backup/models.py (94%) rename {reddwarf => trove}/backup/service.py (88%) rename {reddwarf => trove}/backup/views.py (100%) rename {reddwarf => trove}/common/__init__.py (100%) rename {reddwarf => trove}/common/api.py (87%) rename {reddwarf => trove}/common/auth.py (88%) rename {reddwarf => trove}/common/cfg.py (84%) rename {reddwarf => trove}/common/context.py (85%) rename {reddwarf => trove}/common/exception.py (76%) rename {reddwarf => trove}/common/extensions.py (89%) rename {reddwarf => trove}/common/limits.py (96%) rename {reddwarf => trove}/common/manager.py (89%) rename {reddwarf => trove}/common/models.py (97%) rename {reddwarf => trove}/common/pagination.py (100%) rename {reddwarf => trove}/common/remote.py (88%) rename {reddwarf => trove}/common/rpc.py (84%) rename {reddwarf => trove}/common/schemas/atom-link.rng (100%) rename {reddwarf => trove}/common/schemas/atom.rng (100%) rename {reddwarf => trove}/common/schemas/v1.1/limits.rng (100%) rename {reddwarf => trove}/common/utils.py (95%) rename {reddwarf => trove}/common/views.py (97%) rename {reddwarf => trove}/common/wsgi.py (92%) rename {reddwarf => trove}/db/__init__.py (96%) rename {reddwarf => trove}/db/models.py (92%) rename {reddwarf => trove}/db/sqlalchemy/__init__.py (100%) rename {reddwarf => trove}/db/sqlalchemy/api.py (94%) rename {reddwarf => trove}/db/sqlalchemy/mappers.py (100%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/README (100%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/__init__.py (100%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/manage.py (100%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/migrate.cfg (96%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/schema.py (93%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/001_base_schema.py (74%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/002_service_images.py (70%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py (72%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py (79%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py (71%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/006_dns_records.py (82%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py (87%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py (87%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py (86%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/010_add_usage.py (79%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/011_quota.py (86%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/012_backup.py (79%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py (87%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py (85%) rename {reddwarf => trove}/db/sqlalchemy/migrate_repo/versions/__init__.py (100%) rename {reddwarf => trove}/db/sqlalchemy/migration.py (96%) rename {reddwarf => trove}/db/sqlalchemy/session.py (81%) rename {reddwarf => trove}/dns/__init__.py (100%) rename {reddwarf => trove}/dns/driver.py (100%) rename {reddwarf => trove}/dns/manager.py (91%) rename {reddwarf => trove}/dns/models.py (90%) rename {reddwarf => trove}/dns/rsdns/__init__.py (100%) rename {reddwarf => trove}/dns/rsdns/driver.py (97%) rename {reddwarf => trove}/extensions/__init__.py (100%) rename {reddwarf => trove}/extensions/account.py (82%) rename {reddwarf => trove}/extensions/account/__init__.py (100%) rename {reddwarf => trove}/extensions/account/models.py (90%) rename {reddwarf => trove}/extensions/account/service.py (79%) rename {reddwarf => trove}/extensions/account/views.py (100%) rename {reddwarf => trove}/extensions/mgmt.py (81%) rename {reddwarf => trove}/extensions/mgmt/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/host/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/host/instance/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/host/instance/service.py (90%) rename {reddwarf => trove}/extensions/mgmt/host/models.py (85%) rename {reddwarf => trove}/extensions/mgmt/host/service.py (78%) rename {reddwarf => trove}/extensions/mgmt/host/views.py (100%) rename {reddwarf => trove}/extensions/mgmt/instances/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/instances/models.py (94%) rename {reddwarf => trove}/extensions/mgmt/instances/service.py (90%) rename {reddwarf => trove}/extensions/mgmt/instances/views.py (99%) rename {reddwarf => trove}/extensions/mgmt/quota/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/quota/service.py (87%) rename {reddwarf => trove}/extensions/mgmt/quota/views.py (100%) rename {reddwarf => trove}/extensions/mgmt/volume/__init__.py (100%) rename {reddwarf => trove}/extensions/mgmt/volume/models.py (93%) rename {reddwarf => trove}/extensions/mgmt/volume/service.py (78%) rename {reddwarf => trove}/extensions/mgmt/volume/views.py (100%) rename {reddwarf => trove}/extensions/mysql.py (83%) rename {reddwarf => trove}/extensions/mysql/__init__.py (100%) rename {reddwarf => trove}/extensions/mysql/common.py (95%) rename {reddwarf => trove}/extensions/mysql/models.py (96%) rename {reddwarf => trove}/extensions/mysql/service.py (95%) rename {reddwarf => trove}/extensions/mysql/views.py (100%) rename {reddwarf => trove}/extensions/security_group.py (80%) rename {reddwarf => trove}/extensions/security_group/__init__.py (100%) rename {reddwarf => trove}/extensions/security_group/models.py (91%) rename {reddwarf => trove}/extensions/security_group/service.py (89%) rename {reddwarf => trove}/extensions/security_group/views.py (98%) rename {reddwarf => trove}/flavor/__init__.py (100%) rename {reddwarf => trove}/flavor/models.py (89%) rename {reddwarf => trove}/flavor/service.py (90%) rename {reddwarf => trove}/flavor/views.py (90%) rename {reddwarf => trove}/guestagent/__init__.py (100%) rename {reddwarf => trove}/guestagent/api.py (96%) rename {reddwarf => trove}/guestagent/backup/__init__.py (93%) rename {reddwarf => trove}/guestagent/backup/backupagent.py (88%) rename {reddwarf => trove}/guestagent/db/__init__.py (100%) rename {reddwarf => trove}/guestagent/db/models.py (99%) rename {reddwarf => trove}/guestagent/dbaas.py (89%) rename {reddwarf => trove}/guestagent/manager/__init__.py (100%) rename {reddwarf => trove}/guestagent/manager/mysql.py (90%) rename {reddwarf => trove}/guestagent/manager/mysql_service.py (98%) rename {reddwarf => trove}/guestagent/models.py (86%) rename {reddwarf => trove}/guestagent/pkg.py (94%) rename {reddwarf => trove}/guestagent/query.py (100%) rename {reddwarf => trove}/guestagent/service.py (93%) rename {reddwarf => trove}/guestagent/strategies/__init__.py (100%) rename {reddwarf => trove}/guestagent/strategies/backup/__init__.py (89%) rename {reddwarf => trove}/guestagent/strategies/backup/base.py (95%) rename {reddwarf => trove}/guestagent/strategies/backup/impl.py (94%) rename {reddwarf => trove}/guestagent/strategies/restore/__init__.py (88%) rename {reddwarf => trove}/guestagent/strategies/restore/base.py (96%) rename {reddwarf => trove}/guestagent/strategies/restore/impl.py (90%) rename {reddwarf => trove}/guestagent/strategies/storage/__init__.py (89%) rename {reddwarf => trove}/guestagent/strategies/storage/base.py (87%) rename {reddwarf => trove}/guestagent/strategies/storage/swift.py (96%) rename {reddwarf => trove}/guestagent/strategy.py (95%) rename {reddwarf => trove}/guestagent/volume.py (96%) rename {reddwarf => trove}/instance/__init__.py (100%) rename {reddwarf => trove}/instance/models.py (95%) rename {reddwarf => trove}/instance/service.py (91%) rename {reddwarf => trove}/instance/tasks.py (98%) rename {reddwarf => trove}/instance/views.py (91%) rename {reddwarf => trove}/limits/__init__.py (100%) rename {reddwarf => trove}/limits/service.py (87%) rename {reddwarf => trove}/limits/views.py (97%) rename {reddwarf => trove}/openstack/__init__.py (100%) rename {reddwarf => trove}/openstack/common/README (100%) rename {reddwarf => trove}/openstack/common/__init__.py (100%) rename {reddwarf => trove}/openstack/common/config.py (100%) rename {reddwarf => trove}/openstack/common/context.py (98%) rename {reddwarf => trove}/openstack/common/eventlet_backdoor.py (100%) rename {reddwarf => trove}/openstack/common/exception.py (98%) rename {reddwarf => trove}/openstack/common/excutils.py (97%) rename {reddwarf => trove}/openstack/common/extensions.py (99%) rename {reddwarf => trove}/openstack/common/fileutils.py (100%) rename {reddwarf => trove}/openstack/common/gettextutils.py (87%) rename {reddwarf => trove}/openstack/common/importutils.py (100%) rename {reddwarf => trove}/openstack/common/iniparser.py (100%) rename {reddwarf => trove}/openstack/common/jsonutils.py (99%) rename {reddwarf => trove}/openstack/common/local.py (100%) rename {reddwarf => trove}/openstack/common/lockutils.py (98%) rename {reddwarf => trove}/openstack/common/log.py (98%) rename {reddwarf => trove}/openstack/common/loopingcall.py (96%) rename {reddwarf => trove}/openstack/common/middleware/__init__.py (100%) rename {reddwarf => trove}/openstack/common/middleware/context.py (93%) rename {reddwarf => trove}/openstack/common/network_utils.py (97%) rename {reddwarf => trove}/openstack/common/notifier/__init__.py (100%) rename {reddwarf => trove}/openstack/common/notifier/api.py (94%) rename {reddwarf => trove}/openstack/common/notifier/log_notifier.py (87%) rename {reddwarf => trove}/openstack/common/notifier/no_op_notifier.py (100%) rename {reddwarf => trove}/openstack/common/notifier/rabbit_notifier.py (84%) rename {reddwarf => trove}/openstack/common/notifier/rpc_notifier.py (87%) rename {reddwarf => trove}/openstack/common/notifier/rpc_notifier2.py (89%) rename {reddwarf => trove}/openstack/common/notifier/test_notifier.py (100%) rename {reddwarf => trove}/openstack/common/pastedeploy.py (99%) rename {reddwarf => trove}/openstack/common/periodic_task.py (97%) rename {reddwarf => trove}/openstack/common/policy.py (99%) rename {reddwarf => trove}/openstack/common/processutils.py (98%) rename {reddwarf => trove}/openstack/common/rpc/__init__.py (97%) rename {reddwarf => trove}/openstack/common/rpc/amqp.py (98%) rename {reddwarf => trove}/openstack/common/rpc/common.py (98%) rename {reddwarf => trove}/openstack/common/rpc/dispatcher.py (98%) rename {reddwarf => trove}/openstack/common/rpc/impl_fake.py (98%) rename {reddwarf => trove}/openstack/common/rpc/impl_kombu.py (99%) rename {reddwarf => trove}/openstack/common/rpc/impl_qpid.py (98%) rename {reddwarf => trove}/openstack/common/rpc/impl_zmq.py (98%) rename {reddwarf => trove}/openstack/common/rpc/matchmaker.py (99%) rename {reddwarf => trove}/openstack/common/rpc/matchmaker_redis.py (96%) rename {reddwarf => trove}/openstack/common/rpc/proxy.py (99%) rename {reddwarf => trove}/openstack/common/rpc/service.py (90%) rename {reddwarf => trove}/openstack/common/rpc/zmq_receiver.py (88%) rename {reddwarf => trove}/openstack/common/service.py (96%) rename {reddwarf => trove}/openstack/common/sslutils.py (97%) rename {reddwarf => trove}/openstack/common/testutils.py (100%) rename {reddwarf => trove}/openstack/common/threadgroup.py (97%) rename {reddwarf => trove}/openstack/common/timeutils.py (100%) rename {reddwarf => trove}/openstack/common/utils.py (100%) rename {reddwarf => trove}/openstack/common/uuidutils.py (100%) rename {reddwarf => trove}/openstack/common/wsgi.py (98%) rename {reddwarf => trove}/openstack/common/xmlutils.py (100%) rename {reddwarf => trove}/quota/__init__.py (100%) rename {reddwarf => trove}/quota/models.py (94%) rename {reddwarf => trove}/quota/quota.py (96%) rename {reddwarf => trove}/taskmanager/__init__.py (100%) rename {reddwarf => trove}/taskmanager/api.py (94%) rename {reddwarf => trove}/taskmanager/manager.py (89%) rename {reddwarf => trove}/taskmanager/models.py (92%) rename {reddwarf => trove}/taskmanager/service.py (94%) rename {reddwarf => trove}/tests/__init__.py (100%) rename {reddwarf => trove}/tests/api/__init__.py (100%) rename {reddwarf => trove}/tests/api/backups.py (96%) rename {reddwarf => trove}/tests/api/databases.py (97%) rename {reddwarf => trove}/tests/api/flavors.py (92%) rename {reddwarf => trove}/tests/api/header.py (81%) rename {reddwarf => trove}/tests/api/instances.py (97%) rename {reddwarf => trove}/tests/api/instances_actions.py (95%) rename {reddwarf => trove}/tests/api/instances_delete.py (92%) rename {reddwarf => trove}/tests/api/instances_mysql_down.py (93%) rename {reddwarf => trove}/tests/api/instances_resize.py (94%) rename {reddwarf => trove}/tests/api/limits.py (90%) rename {reddwarf => trove}/tests/api/mgmt/__init__.py (100%) rename {reddwarf => trove}/tests/api/mgmt/accounts.py (94%) rename {reddwarf => trove}/tests/api/mgmt/admin_required.py (93%) rename {reddwarf => trove}/tests/api/mgmt/instances.py (90%) rename {reddwarf => trove}/tests/api/mgmt/instances_actions.py (88%) rename {reddwarf => trove}/tests/api/mgmt/malformed_json.py (95%) rename {reddwarf => trove}/tests/api/mgmt/quotas.py (84%) rename {reddwarf => trove}/tests/api/mgmt/storage.py (92%) rename {reddwarf => trove}/tests/api/root.py (95%) rename {reddwarf => trove}/tests/api/user_access.py (98%) rename {reddwarf => trove}/tests/api/users.py (97%) rename {reddwarf => trove}/tests/api/versions.py (89%) rename {reddwarf => trove}/tests/config.py (93%) rename {reddwarf => trove}/tests/fakes/__init__.py (100%) rename {reddwarf => trove}/tests/fakes/common.py (96%) rename {reddwarf => trove}/tests/fakes/guestagent.py (93%) rename {reddwarf => trove}/tests/fakes/keystone.py (100%) rename {reddwarf => trove}/tests/fakes/nova.py (98%) rename {reddwarf => trove}/tests/fakes/swift.py (100%) rename {reddwarf => trove}/tests/unittests/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/api/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/api/common/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/api/common/test_limits.py (98%) rename {reddwarf => trove}/tests/unittests/api/test_versions.py (97%) rename {reddwarf => trove}/tests/unittests/backup/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/backup/test_backup_models.py (95%) rename {reddwarf => trove}/tests/unittests/backup/test_backupagent.py (90%) rename {reddwarf => trove}/tests/unittests/backup/test_storage.py (100%) rename {reddwarf => trove}/tests/unittests/common/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/common/test_remote.py (96%) rename {reddwarf => trove}/tests/unittests/guestagent/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/guestagent/test_api.py (98%) rename {reddwarf => trove}/tests/unittests/guestagent/test_dbaas.py (96%) rename {reddwarf => trove}/tests/unittests/guestagent/test_dbmodels.py (94%) rename {reddwarf => trove}/tests/unittests/guestagent/test_manager.py (95%) rename {reddwarf => trove}/tests/unittests/guestagent/test_models.py (94%) rename {reddwarf => trove}/tests/unittests/guestagent/test_pkg.py (98%) rename {reddwarf => trove}/tests/unittests/guestagent/test_query.py (99%) rename {reddwarf => trove}/tests/unittests/guestagent/test_service.py (96%) rename {reddwarf => trove}/tests/unittests/guestagent/test_volume.py (98%) rename {reddwarf => trove}/tests/unittests/mgmt/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/mgmt/test_models.py (93%) rename {reddwarf => trove}/tests/unittests/quota/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/quota/test_quota.py (97%) rename {reddwarf => trove}/tests/unittests/secgroups/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/secgroups/test_security_group.py (88%) rename {reddwarf => trove}/tests/unittests/taskmanager/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/taskmanager/test_models.py (96%) rename {reddwarf => trove}/tests/unittests/util/__init__.py (100%) rename {reddwarf => trove}/tests/unittests/util/matchers.py (100%) rename {reddwarf => trove}/tests/unittests/util/util.py (85%) rename {reddwarf => trove}/tests/util/__init__.py (85%) rename {reddwarf => trove}/tests/util/check.py (100%) rename {reddwarf => trove}/tests/util/client.py (96%) rename {reddwarf => trove}/tests/util/mysql.py (98%) rename {reddwarf => trove}/tests/util/server_connection.py (93%) rename {reddwarf => trove}/tests/util/usage.py (97%) rename {reddwarf => trove}/tests/util/users.py (99%) rename {reddwarf => trove}/version.py (96%) rename {reddwarf => trove}/versions.py (99%) diff --git a/.coveragerc b/.coveragerc index 42c30db1b7..35baa3dde8 100644 --- a/.coveragerc +++ b/.coveragerc @@ -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 diff --git a/.gitignore b/.gitignore index 9a45b8b3bd..86028d5c23 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.testr.conf b/.testr.conf index aa46b9cb39..9a61386854 100644 --- a/.testr.conf +++ b/.testr.conf @@ -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 diff --git a/MANIFEST.in b/MANIFEST.in index 7c69a6a372..05ab744426 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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/*.* \ No newline at end of file +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/*.* diff --git a/bin/start_server.sh b/bin/start_server.sh index dc353185b1..2f3e368231 100755 --- a/bin/start_server.sh +++ b/bin/start_server.sh @@ -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 \ $@ diff --git a/bin/reddwarf-api b/bin/trove-api similarity index 73% rename from bin/reddwarf-api rename to bin/trove-api index b11f7feaf8..1ff98f94a2 100755 --- a/bin/reddwarf-api +++ b/bin/trove-api @@ -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 diff --git a/bin/reddwarf-api-os-database b/bin/trove-api-os-database similarity index 84% rename from bin/reddwarf-api-os-database rename to bin/trove-api-os-database index c4c28f4a92..fb586070a5 100755 --- a/bin/reddwarf-api-os-database +++ b/bin/trove-api-os-database @@ -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() diff --git a/bin/reddwarf-cli b/bin/trove-cli similarity index 97% rename from bin/reddwarf-cli rename to bin/trove-cli index 0641507638..f84cd02b3c 100755 --- a/bin/reddwarf-cli +++ b/bin/trove-cli @@ -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 diff --git a/bin/reddwarf-guestagent b/bin/trove-guestagent similarity index 80% rename from bin/reddwarf-guestagent rename to bin/trove-guestagent index cabb15342d..4e654da113 100755 --- a/bin/reddwarf-guestagent +++ b/bin/trove-guestagent @@ -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'), diff --git a/bin/reddwarf-manage b/bin/trove-manage similarity index 87% rename from bin/reddwarf-manage rename to bin/trove-manage index 561c14670c..4938dff036 100755 --- a/bin/reddwarf-manage +++ b/bin/trove-manage @@ -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... diff --git a/bin/reddwarf-mgmt-taskmanager b/bin/trove-mgmt-taskmanager similarity index 80% rename from bin/reddwarf-mgmt-taskmanager rename to bin/trove-mgmt-taskmanager index 15078276f5..2145d68817 100755 --- a/bin/reddwarf-mgmt-taskmanager +++ b/bin/trove-mgmt-taskmanager @@ -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')]) diff --git a/bin/reddwarf-server b/bin/trove-server similarity index 81% rename from bin/reddwarf-server rename to bin/trove-server index 7760eec5e8..bbc79d49fa 100755 --- a/bin/reddwarf-server +++ b/bin/trove-server @@ -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) diff --git a/bin/reddwarf-taskmanager b/bin/trove-taskmanager similarity index 79% rename from bin/reddwarf-taskmanager rename to bin/trove-taskmanager index 4294a19abc..6d958e7922 100755 --- a/bin/reddwarf-taskmanager +++ b/bin/trove-taskmanager @@ -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')]) diff --git a/development/FunkyBugs.txt b/development/FunkyBugs.txt deleted file mode 100644 index 4226de9b72..0000000000 --- a/development/FunkyBugs.txt +++ /dev/null @@ -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 \ No newline at end of file diff --git a/development/bootstrap/bootstrap.sh b/development/bootstrap/bootstrap.sh deleted file mode 100755 index e5fa53862b..0000000000 --- a/development/bootstrap/bootstrap.sh +++ /dev/null @@ -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';" \ No newline at end of file diff --git a/development/bootstrap/bootstrap_init.sh b/development/bootstrap/bootstrap_init.sh deleted file mode 100644 index d5cda29951..0000000000 --- a/development/bootstrap/bootstrap_init.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/development/deprecated-bootstrap.sh b/development/deprecated-bootstrap.sh deleted file mode 100644 index c4d171b63d..0000000000 --- a/development/deprecated-bootstrap.sh +++ /dev/null @@ -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= -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"}' \ No newline at end of file diff --git a/development/development_enviroment.sh b/development/development_enviroment.sh deleted file mode 100644 index 0c0ea4b292..0000000000 --- a/development/development_enviroment.sh +++ /dev/null @@ -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');" - diff --git a/development/instance_source.sh b/development/instance_source.sh deleted file mode 100644 index 2f0c2e39f7..0000000000 --- a/development/instance_source.sh +++ /dev/null @@ -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 -} - diff --git a/etc/nova/nova.conf.template b/etc/nova/nova.conf.template deleted file mode 100644 index 07be08d38f..0000000000 --- a/etc/nova/nova.conf.template +++ /dev/null @@ -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. diff --git a/etc/nova/reddwarf-api-paste.ini b/etc/nova/reddwarf-api-paste.ini deleted file mode 100644 index d08d193ac9..0000000000 --- a/etc/nova/reddwarf-api-paste.ini +++ /dev/null @@ -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 diff --git a/etc/reddwarf/api-paste.ini b/etc/reddwarf/api-paste.ini deleted file mode 100644 index bad4cb4866..0000000000 --- a/etc/reddwarf/api-paste.ini +++ /dev/null @@ -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 diff --git a/etc/reddwarf/api-paste.ini.test b/etc/reddwarf/api-paste.ini.test deleted file mode 100644 index 3415f2ed7d..0000000000 --- a/etc/reddwarf/api-paste.ini.test +++ /dev/null @@ -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 diff --git a/etc/tests/core.test.conf b/etc/tests/core.test.conf index f08192f821..07f8181874 100644 --- a/etc/tests/core.test.conf +++ b/etc/tests/core.test.conf @@ -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 } diff --git a/etc/tests/localhost.test.conf b/etc/tests/localhost.test.conf index ac58cea8c3..74f06be944 100644 --- a/etc/tests/localhost.test.conf +++ b/etc/tests/localhost.test.conf @@ -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"] } } ], diff --git a/etc/tests/xml.localhost.test.conf b/etc/tests/xml.localhost.test.conf index d7590f8b20..a2f5d873b7 100644 --- a/etc/tests/xml.localhost.test.conf +++ b/etc/tests/xml.localhost.test.conf @@ -1,4 +1,4 @@ { "include-files": ["localhost.test.conf"], - "reddwarf_client_cls": "reddwarfclient.xml.ReddwarfXmlClient" + "trove_client_cls": "troveclient.xml.TroveXmlClient" } diff --git a/etc/trove/api-paste.ini b/etc/trove/api-paste.ini new file mode 100644 index 0000000000..677b8430b9 --- /dev/null +++ b/etc/trove/api-paste.ini @@ -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 diff --git a/etc/trove/api-paste.ini.test b/etc/trove/api-paste.ini.test new file mode 100644 index 0000000000..d106f2d78f --- /dev/null +++ b/etc/trove/api-paste.ini.test @@ -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 diff --git a/etc/reddwarf/conf.d/README b/etc/trove/conf.d/README similarity index 100% rename from etc/reddwarf/conf.d/README rename to etc/trove/conf.d/README diff --git a/etc/reddwarf/conf.d/guest_info b/etc/trove/conf.d/guest_info similarity index 100% rename from etc/reddwarf/conf.d/guest_info rename to etc/trove/conf.d/guest_info diff --git a/etc/reddwarf/reddwarf-guestagent.conf.sample b/etc/trove/trove-guestagent.conf.sample similarity index 80% rename from etc/reddwarf/reddwarf-guestagent.conf.sample rename to etc/trove/trove-guestagent.conf.sample index e256477649..5e9cd7550b 100644 --- a/etc/reddwarf/reddwarf-guestagent.conf.sample +++ b/etc/trove/trove-guestagent.conf.sample @@ -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 diff --git a/etc/reddwarf/reddwarf-taskmanager.conf.sample b/etc/trove/trove-taskmanager.conf.sample similarity index 79% rename from etc/reddwarf/reddwarf-taskmanager.conf.sample rename to etc/trove/trove-taskmanager.conf.sample index 6068077b73..964fd0e195 100644 --- a/etc/reddwarf/reddwarf-taskmanager.conf.sample +++ b/etc/trove/trove-taskmanager.conf.sample @@ -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 diff --git a/etc/reddwarf/reddwarf.conf.sample b/etc/trove/trove.conf.sample similarity index 79% rename from etc/reddwarf/reddwarf.conf.sample rename to etc/trove/trove.conf.sample index 83fd70c3ba..9101887cca 100644 --- a/etc/reddwarf/reddwarf.conf.sample +++ b/etc/trove/trove.conf.sample @@ -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. diff --git a/etc/reddwarf/reddwarf.conf.test b/etc/trove/trove.conf.test similarity index 69% rename from etc/reddwarf/reddwarf.conf.test rename to etc/trove/trove.conf.test index b68d6480ea..966980332c 100644 --- a/etc/reddwarf/reddwarf.conf.test +++ b/etc/trove/trove.conf.test @@ -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 diff --git a/openstack-common.conf b/openstack-common.conf index fa30500896..7c842a1425 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -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 diff --git a/reddwarf/README b/reddwarf/README deleted file mode 100644 index a0c96bf9d8..0000000000 --- a/reddwarf/README +++ /dev/null @@ -1 +0,0 @@ -This is the reddwarf code itself diff --git a/rsdns/client/dns_client.py b/rsdns/client/dns_client.py index 77013bc9af..07878241fc 100644 --- a/rsdns/client/dns_client.py +++ b/rsdns/client/dns_client.py @@ -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 diff --git a/run_tests.py b/run_tests.py index e03a81b582..98b24af8ac 100644 --- a/run_tests.py +++ b/run_tests.py @@ -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() diff --git a/run_tests.sh b/run_tests.sh index 357ce3ddfb..d05d274226 100755 --- a/run_tests.sh +++ b/run_tests.sh @@ -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 { diff --git a/setup.cfg b/setup.cfg index 419cdf1439..c41d0ef7f4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 = diff --git a/tools/install_venv.py b/tools/install_venv.py index 4debd4c826..e25bed8202 100755 --- a/tools/install_venv.py +++ b/tools/install_venv.py @@ -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 diff --git a/trove/README b/trove/README new file mode 100644 index 0000000000..ab9eda0209 --- /dev/null +++ b/trove/README @@ -0,0 +1 @@ +This is the trove code itself diff --git a/reddwarf/__init__.py b/trove/__init__.py similarity index 92% rename from reddwarf/__init__.py rename to trove/__init__.py index 4865a1ed7a..b3bc3ec742 100644 --- a/reddwarf/__init__.py +++ b/trove/__init__.py @@ -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 diff --git a/reddwarf/backup/__init__.py b/trove/backup/__init__.py similarity index 100% rename from reddwarf/backup/__init__.py rename to trove/backup/__init__.py diff --git a/reddwarf/backup/models.py b/trove/backup/models.py similarity index 94% rename from reddwarf/backup/models.py rename to trove/backup/models.py index 927854568e..64285d3f6c 100644 --- a/reddwarf/backup/models.py +++ b/trove/backup/models.py @@ -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() diff --git a/reddwarf/backup/service.py b/trove/backup/service.py similarity index 88% rename from reddwarf/backup/service.py rename to trove/backup/service.py index 5e503aebc0..ccc0021f12 100644 --- a/reddwarf/backup/service.py +++ b/trove/backup/service.py @@ -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) diff --git a/reddwarf/backup/views.py b/trove/backup/views.py similarity index 100% rename from reddwarf/backup/views.py rename to trove/backup/views.py diff --git a/reddwarf/common/__init__.py b/trove/common/__init__.py similarity index 100% rename from reddwarf/common/__init__.py rename to trove/common/__init__.py diff --git a/reddwarf/common/api.py b/trove/common/api.py similarity index 87% rename from reddwarf/common/api.py rename to trove/common/api.py index 149a523d25..df7203b51d 100644 --- a/reddwarf/common/api.py +++ b/trove/common/api.py @@ -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): diff --git a/reddwarf/common/auth.py b/trove/common/auth.py similarity index 88% rename from reddwarf/common/auth.py rename to trove/common/auth.py index 7c748e0f8a..148d22bca5 100644 --- a/reddwarf/common/auth.py +++ b/trove/common/auth.py @@ -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.*?)/.*") 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) diff --git a/reddwarf/common/cfg.py b/trove/common/cfg.py similarity index 84% rename from reddwarf/common/cfg.py rename to trove/common/cfg.py index ed3eb45999..5f29996382 100644 --- a/reddwarf/common/cfg.py +++ b/trove/common/cfg.py @@ -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) diff --git a/reddwarf/common/context.py b/trove/common/context.py similarity index 85% rename from reddwarf/common/context.py rename to trove/common/context.py index 1ecee85abd..aeb60d2d73 100644 --- a/reddwarf/common/context.py +++ b/trove/common/context.py @@ -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 }) diff --git a/reddwarf/common/exception.py b/trove/common/exception.py similarity index 76% rename from reddwarf/common/exception.py rename to trove/common/exception.py index 66ca52cc93..57f92873d4 100644 --- a/reddwarf/common/exception.py +++ b/trove/common/exception.py @@ -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.") diff --git a/reddwarf/common/extensions.py b/trove/common/extensions.py similarity index 89% rename from reddwarf/common/extensions.py rename to trove/common/extensions.py index 761bbd6270..a3ea18a34f 100644 --- a/reddwarf/common/extensions.py +++ b/trove/common/extensions.py @@ -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 diff --git a/reddwarf/common/limits.py b/trove/common/limits.py similarity index 96% rename from reddwarf/common/limits.py rename to trove/common/limits.py index 56289dd591..53f35294c6 100644 --- a/reddwarf/common/limits.py +++ b/trove/common/limits.py @@ -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 diff --git a/reddwarf/common/manager.py b/trove/common/manager.py similarity index 89% rename from reddwarf/common/manager.py rename to trove/common/manager.py index 00c6f7fc47..7f85259788 100644 --- a/reddwarf/common/manager.py +++ b/trove/common/manager.py @@ -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 diff --git a/reddwarf/common/models.py b/trove/common/models.py similarity index 97% rename from reddwarf/common/models.py rename to trove/common/models.py index d1c8989395..47bbbbed1c 100644 --- a/reddwarf/common/models.py +++ b/trove/common/models.py @@ -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__) diff --git a/reddwarf/common/pagination.py b/trove/common/pagination.py similarity index 100% rename from reddwarf/common/pagination.py rename to trove/common/pagination.py diff --git a/reddwarf/common/remote.py b/trove/common/remote.py similarity index 88% rename from reddwarf/common/remote.py rename to trove/common/remote.py index bc9c7d351a..afaa383320 100644 --- a/reddwarf/common/remote.py +++ b/trove/common/remote.py @@ -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 diff --git a/reddwarf/common/rpc.py b/trove/common/rpc.py similarity index 84% rename from reddwarf/common/rpc.py rename to trove/common/rpc.py index 7695f5007a..2fb1cfaa7f 100644 --- a/reddwarf/common/rpc.py +++ b/trove/common/rpc.py @@ -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, diff --git a/reddwarf/common/schemas/atom-link.rng b/trove/common/schemas/atom-link.rng similarity index 100% rename from reddwarf/common/schemas/atom-link.rng rename to trove/common/schemas/atom-link.rng diff --git a/reddwarf/common/schemas/atom.rng b/trove/common/schemas/atom.rng similarity index 100% rename from reddwarf/common/schemas/atom.rng rename to trove/common/schemas/atom.rng diff --git a/reddwarf/common/schemas/v1.1/limits.rng b/trove/common/schemas/v1.1/limits.rng similarity index 100% rename from reddwarf/common/schemas/v1.1/limits.rng rename to trove/common/schemas/v1.1/limits.rng diff --git a/reddwarf/common/utils.py b/trove/common/utils.py similarity index 95% rename from reddwarf/common/utils.py rename to trove/common/utils.py index 4b57c192c4..2028b3165f 100644 --- a/reddwarf/common/utils.py +++ b/trove/common/utils.py @@ -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 diff --git a/reddwarf/common/views.py b/trove/common/views.py similarity index 97% rename from reddwarf/common/views.py rename to trove/common/views.py index e91c936e2b..be98d4b241 100644 --- a/reddwarf/common/views.py +++ b/trove/common/views.py @@ -16,7 +16,7 @@ # under the License. -from reddwarf.common import wsgi +from trove.common import wsgi def create_links(resource_path, request, id): diff --git a/reddwarf/common/wsgi.py b/trove/common/wsgi.py similarity index 92% rename from reddwarf/common/wsgi.py rename to trove/common/wsgi.py index 511c5bb82b..fde1a07087 100644 --- a/reddwarf/common/wsgi.py +++ b/trove/common/wsgi.py @@ -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\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 diff --git a/reddwarf/db/__init__.py b/trove/db/__init__.py similarity index 96% rename from reddwarf/db/__init__.py rename to trove/db/__init__.py index 3717568fd0..f9cfdebde4 100644 --- a/reddwarf/db/__init__.py +++ b/trove/db/__init__.py @@ -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, diff --git a/reddwarf/db/models.py b/trove/db/models.py similarity index 92% rename from reddwarf/db/models.py rename to trove/db/models.py index 8d65672eae..427ac2fa23 100644 --- a/reddwarf/db/models.py +++ b/trove/db/models.py @@ -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__) diff --git a/reddwarf/db/sqlalchemy/__init__.py b/trove/db/sqlalchemy/__init__.py similarity index 100% rename from reddwarf/db/sqlalchemy/__init__.py rename to trove/db/sqlalchemy/__init__.py diff --git a/reddwarf/db/sqlalchemy/api.py b/trove/db/sqlalchemy/api.py similarity index 94% rename from reddwarf/db/sqlalchemy/api.py rename to trove/db/sqlalchemy/api.py index 6483b0eb0a..992176414b 100644 --- a/reddwarf/db/sqlalchemy/api.py +++ b/trove/db/sqlalchemy/api.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/mappers.py b/trove/db/sqlalchemy/mappers.py similarity index 100% rename from reddwarf/db/sqlalchemy/mappers.py rename to trove/db/sqlalchemy/mappers.py diff --git a/reddwarf/db/sqlalchemy/migrate_repo/README b/trove/db/sqlalchemy/migrate_repo/README similarity index 100% rename from reddwarf/db/sqlalchemy/migrate_repo/README rename to trove/db/sqlalchemy/migrate_repo/README diff --git a/reddwarf/db/sqlalchemy/migrate_repo/__init__.py b/trove/db/sqlalchemy/migrate_repo/__init__.py similarity index 100% rename from reddwarf/db/sqlalchemy/migrate_repo/__init__.py rename to trove/db/sqlalchemy/migrate_repo/__init__.py diff --git a/reddwarf/db/sqlalchemy/migrate_repo/manage.py b/trove/db/sqlalchemy/migrate_repo/manage.py similarity index 100% rename from reddwarf/db/sqlalchemy/migrate_repo/manage.py rename to trove/db/sqlalchemy/migrate_repo/manage.py diff --git a/reddwarf/db/sqlalchemy/migrate_repo/migrate.cfg b/trove/db/sqlalchemy/migrate_repo/migrate.cfg similarity index 96% rename from reddwarf/db/sqlalchemy/migrate_repo/migrate.cfg rename to trove/db/sqlalchemy/migrate_repo/migrate.cfg index 3089120144..4e362a237c 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/migrate.cfg +++ b/trove/db/sqlalchemy/migrate_repo/migrate.cfg @@ -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. diff --git a/reddwarf/db/sqlalchemy/migrate_repo/schema.py b/trove/db/sqlalchemy/migrate_repo/schema.py similarity index 93% rename from reddwarf/db/sqlalchemy/migrate_repo/schema.py rename to trove/db/sqlalchemy/migrate_repo/schema.py index 1d112c73de..d94dfa7faf 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/schema.py +++ b/trove/db/sqlalchemy/migrate_repo/schema.py @@ -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( diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/001_base_schema.py b/trove/db/sqlalchemy/migrate_repo/versions/001_base_schema.py similarity index 74% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/001_base_schema.py rename to trove/db/sqlalchemy/migrate_repo/versions/001_base_schema.py index bd748895dc..92810801c5 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/001_base_schema.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/001_base_schema.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/002_service_images.py b/trove/db/sqlalchemy/migrate_repo/versions/002_service_images.py similarity index 70% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/002_service_images.py rename to trove/db/sqlalchemy/migrate_repo/versions/002_service_images.py index 7728babf59..b9b180c16e 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/002_service_images.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/002_service_images.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py b/trove/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py similarity index 72% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py rename to trove/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py index 12c15ae1ab..c092714d8d 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/003_service_statuses.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py b/trove/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py similarity index 79% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py rename to trove/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py index 50a8fb3639..6cd2a5ab89 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/004_root_enabled.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py b/trove/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py similarity index 71% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py rename to trove/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py index ac5ab9c4b2..602ead82b0 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/005_heartbeat.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/006_dns_records.py b/trove/db/sqlalchemy/migrate_repo/versions/006_dns_records.py similarity index 82% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/006_dns_records.py rename to trove/db/sqlalchemy/migrate_repo/versions/006_dns_records.py index b41f606ced..2c0d451921 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/006_dns_records.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/006_dns_records.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py b/trove/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py similarity index 87% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py rename to trove/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py index 9769da837f..829a8a4bb9 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/007_add_volume_flavor.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py b/trove/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py similarity index 87% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py rename to trove/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py index 5944e9d2e6..4e2e97be51 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/008_add_instance_fields.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py b/trove/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py similarity index 86% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py rename to trove/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py index fa0651e9bb..69d2293691 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/009_add_deleted_flag_to_instances.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/010_add_usage.py b/trove/db/sqlalchemy/migrate_repo/versions/010_add_usage.py similarity index 79% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/010_add_usage.py rename to trove/db/sqlalchemy/migrate_repo/versions/010_add_usage.py index 041eeaca06..94ba3cf74f 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/010_add_usage.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/010_add_usage.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/011_quota.py b/trove/db/sqlalchemy/migrate_repo/versions/011_quota.py similarity index 86% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/011_quota.py rename to trove/db/sqlalchemy/migrate_repo/versions/011_quota.py index ccbc85ad22..0a189181c5 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/011_quota.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/011_quota.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/012_backup.py b/trove/db/sqlalchemy/migrate_repo/versions/012_backup.py similarity index 79% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/012_backup.py rename to trove/db/sqlalchemy/migrate_repo/versions/012_backup.py index e42f1ff6b6..d5df4d88ef 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/012_backup.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/012_backup.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py b/trove/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py similarity index 87% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py rename to trove/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py index 6a1fd63807..ae648aaed4 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/013_add_security_group_artifacts.py @@ -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() diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py b/trove/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py similarity index 85% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py rename to trove/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py index 4aef9a5df7..257ecdcab5 100644 --- a/reddwarf/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py +++ b/trove/db/sqlalchemy/migrate_repo/versions/014_update_instance_flavor_id.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/migrate_repo/versions/__init__.py b/trove/db/sqlalchemy/migrate_repo/versions/__init__.py similarity index 100% rename from reddwarf/db/sqlalchemy/migrate_repo/versions/__init__.py rename to trove/db/sqlalchemy/migrate_repo/versions/__init__.py diff --git a/reddwarf/db/sqlalchemy/migration.py b/trove/db/sqlalchemy/migration.py similarity index 96% rename from reddwarf/db/sqlalchemy/migration.py rename to trove/db/sqlalchemy/migration.py index 7ebb9ab3c9..e18ea757b6 100644 --- a/reddwarf/db/sqlalchemy/migration.py +++ b/trove/db/sqlalchemy/migration.py @@ -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): diff --git a/reddwarf/db/sqlalchemy/session.py b/trove/db/sqlalchemy/session.py similarity index 81% rename from reddwarf/db/sqlalchemy/session.py rename to trove/db/sqlalchemy/session.py index 608272dd45..12108a25ba 100644 --- a/reddwarf/db/sqlalchemy/session.py +++ b/trove/db/sqlalchemy/session.py @@ -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, diff --git a/reddwarf/dns/__init__.py b/trove/dns/__init__.py similarity index 100% rename from reddwarf/dns/__init__.py rename to trove/dns/__init__.py diff --git a/reddwarf/dns/driver.py b/trove/dns/driver.py similarity index 100% rename from reddwarf/dns/driver.py rename to trove/dns/driver.py diff --git a/reddwarf/dns/manager.py b/trove/dns/manager.py similarity index 91% rename from reddwarf/dns/manager.py rename to trove/dns/manager.py index e41d616ad2..a11466734a 100644 --- a/reddwarf/dns/manager.py +++ b/trove/dns/manager.py @@ -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. """ diff --git a/reddwarf/dns/models.py b/trove/dns/models.py similarity index 90% rename from reddwarf/dns/models.py rename to trove/dns/models.py index 354ac5583f..331a2ebe3f 100644 --- a/reddwarf/dns/models.py +++ b/trove/dns/models.py @@ -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__) diff --git a/reddwarf/dns/rsdns/__init__.py b/trove/dns/rsdns/__init__.py similarity index 100% rename from reddwarf/dns/rsdns/__init__.py rename to trove/dns/rsdns/__init__.py diff --git a/reddwarf/dns/rsdns/driver.py b/trove/dns/rsdns/driver.py similarity index 97% rename from reddwarf/dns/rsdns/driver.py rename to trove/dns/rsdns/driver.py index 790039e3c2..0865743524 100644 --- a/reddwarf/dns/rsdns/driver.py +++ b/trove/dns/rsdns/driver.py @@ -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 diff --git a/reddwarf/extensions/__init__.py b/trove/extensions/__init__.py similarity index 100% rename from reddwarf/extensions/__init__.py rename to trove/extensions/__init__.py diff --git a/reddwarf/extensions/account.py b/trove/extensions/account.py similarity index 82% rename from reddwarf/extensions/account.py rename to trove/extensions/account.py index 4a3339800d..784db48164 100644 --- a/reddwarf/extensions/account.py +++ b/trove/extensions/account.py @@ -13,11 +13,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.common import extensions -from reddwarf.common import wsgi -from reddwarf.extensions.account import service +from trove.common import extensions +from trove.common import wsgi +from trove.extensions.account import service LOG = logging.getLogger(__name__) @@ -42,9 +42,9 @@ class Account(extensions.ExtensionsDescriptor): def get_resources(self): resources = [] - serializer = wsgi.ReddwarfResponseSerializer( + serializer = wsgi.TroveResponseSerializer( body_serializers={'application/xml': - wsgi.ReddwarfXMLDictSerializer()}) + wsgi.TroveXMLDictSerializer()}) resource = extensions.ResourceExtension( '{tenant_id}/mgmt/accounts', service.AccountController(), diff --git a/reddwarf/extensions/account/__init__.py b/trove/extensions/account/__init__.py similarity index 100% rename from reddwarf/extensions/account/__init__.py rename to trove/extensions/account/__init__.py diff --git a/reddwarf/extensions/account/models.py b/trove/extensions/account/models.py similarity index 90% rename from reddwarf/extensions/account/models.py rename to trove/extensions/account/models.py index 829fe5472b..46b660976f 100644 --- a/reddwarf/extensions/account/models.py +++ b/trove/extensions/account/models.py @@ -15,12 +15,12 @@ # 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.common.remote import create_nova_client -from reddwarf.instance.models import DBInstance -from reddwarf.extensions.mgmt.instances.models import MgmtInstances -from reddwarf.common.exception import Forbidden +from trove.common.remote import create_nova_client +from trove.instance.models import DBInstance +from trove.extensions.mgmt.instances.models import MgmtInstances +from trove.common.exception import Forbidden LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/account/service.py b/trove/extensions/account/service.py similarity index 79% rename from reddwarf/extensions/account/service.py rename to trove/extensions/account/service.py index dccc3898cb..beeb39ac38 100644 --- a/reddwarf/extensions/account/service.py +++ b/trove/extensions/account/service.py @@ -13,19 +13,19 @@ # 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 novaclient import exceptions as nova_exceptions -from reddwarf.common import exception +from trove.common import exception -from reddwarf.common import wsgi -from reddwarf.common.auth import admin_context -from reddwarf.common.remote import create_nova_client -from reddwarf.extensions.account import models -from reddwarf.extensions.account import views -from reddwarf.instance.models import DBInstance -from reddwarf.openstack.common.gettextutils import _ +from trove.common import wsgi +from trove.common.auth import admin_context +from trove.common.remote import create_nova_client +from trove.extensions.account import models +from trove.extensions.account import views +from trove.instance.models import DBInstance +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/account/views.py b/trove/extensions/account/views.py similarity index 100% rename from reddwarf/extensions/account/views.py rename to trove/extensions/account/views.py diff --git a/reddwarf/extensions/mgmt.py b/trove/extensions/mgmt.py similarity index 81% rename from reddwarf/extensions/mgmt.py rename to trove/extensions/mgmt.py index 7be3ccd72f..f46b9ec29d 100644 --- a/reddwarf/extensions/mgmt.py +++ b/trove/extensions/mgmt.py @@ -15,15 +15,15 @@ # 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.common import extensions -from reddwarf.common import wsgi -from reddwarf.extensions.mgmt.instances.service import MgmtInstanceController -from reddwarf.extensions.mgmt.host.service import HostController -from reddwarf.extensions.mgmt.quota.service import QuotaController -from reddwarf.extensions.mgmt.host.instance import service as hostservice -from reddwarf.extensions.mgmt.volume.service import StorageController +from trove.common import extensions +from trove.common import wsgi +from trove.extensions.mgmt.instances.service import MgmtInstanceController +from trove.extensions.mgmt.host.service import HostController +from trove.extensions.mgmt.quota.service import QuotaController +from trove.extensions.mgmt.host.instance import service as hostservice +from trove.extensions.mgmt.volume.service import StorageController LOG = logging.getLogger(__name__) @@ -48,13 +48,13 @@ class Mgmt(extensions.ExtensionsDescriptor): def get_resources(self): resources = [] - serializer = wsgi.ReddwarfResponseSerializer( + serializer = wsgi.TroveResponseSerializer( body_serializers={'application/xml': - wsgi.ReddwarfXMLDictSerializer()}) + wsgi.TroveXMLDictSerializer()}) instances = extensions.ResourceExtension( '{tenant_id}/mgmt/instances', MgmtInstanceController(), - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer, member_actions={'root': 'GET', 'diagnostics': 'GET', diff --git a/reddwarf/extensions/mgmt/__init__.py b/trove/extensions/mgmt/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/__init__.py rename to trove/extensions/mgmt/__init__.py diff --git a/reddwarf/extensions/mgmt/host/__init__.py b/trove/extensions/mgmt/host/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/host/__init__.py rename to trove/extensions/mgmt/host/__init__.py diff --git a/reddwarf/extensions/mgmt/host/instance/__init__.py b/trove/extensions/mgmt/host/instance/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/host/instance/__init__.py rename to trove/extensions/mgmt/host/instance/__init__.py diff --git a/reddwarf/extensions/mgmt/host/instance/service.py b/trove/extensions/mgmt/host/instance/service.py similarity index 90% rename from reddwarf/extensions/mgmt/host/instance/service.py rename to trove/extensions/mgmt/host/instance/service.py index b2f2334c76..90e57e130b 100644 --- a/reddwarf/extensions/mgmt/host/instance/service.py +++ b/trove/extensions/mgmt/host/instance/service.py @@ -16,11 +16,11 @@ # under the License. -from reddwarf.common import exception -from reddwarf.common import wsgi -from reddwarf.extensions.mgmt.host import models -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import wsgi +from trove.extensions.mgmt.host import models +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mgmt/host/models.py b/trove/extensions/mgmt/host/models.py similarity index 85% rename from reddwarf/extensions/mgmt/host/models.py rename to trove/extensions/mgmt/host/models.py index 6cf246a1e8..9794acf0a2 100644 --- a/reddwarf/extensions/mgmt/host/models.py +++ b/trove/extensions/mgmt/host/models.py @@ -19,18 +19,18 @@ Model classes that extend the instances functionality for MySQL instances. """ -from reddwarf.openstack.common import log as logging +from trove.openstack.common import log as logging -from reddwarf import db +from trove import db -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.instance.models import DBInstance -from reddwarf.instance.models import InstanceServiceStatus -from reddwarf.instance.models import SimpleInstance -from reddwarf.guestagent.db import models as guest_models -from reddwarf.common.remote import create_guest_client -from reddwarf.common.remote import create_nova_client +from trove.common import exception +from trove.common import utils +from trove.instance.models import DBInstance +from trove.instance.models import InstanceServiceStatus +from trove.instance.models import SimpleInstance +from trove.guestagent.db import models as guest_models +from trove.common.remote import create_guest_client +from trove.common.remote import create_nova_client from novaclient import exceptions as nova_exceptions @@ -75,7 +75,7 @@ class DetailedHost(object): instance_id=db_info.id) instance_info = SimpleInstance(None, db_info, status) instance['status'] = instance_info.status - except exception.ReddwarfError as re: + except exception.TroveError as re: LOG.error(re) LOG.error("Compute Instance ID found with no associated RD " "instance: %s" % instance['server_id']) @@ -89,7 +89,7 @@ class DetailedHost(object): client = create_guest_client(context, instance['id']) try: client.update_guest() - except exception.ReddwarfError as re: + except exception.TroveError as re: LOG.error(re) LOG.error("Unable to update instance: %s" % instance['id']) failed_instances.append(instance['id']) diff --git a/reddwarf/extensions/mgmt/host/service.py b/trove/extensions/mgmt/host/service.py similarity index 78% rename from reddwarf/extensions/mgmt/host/service.py rename to trove/extensions/mgmt/host/service.py index 0097979659..e9da86eff1 100644 --- a/reddwarf/extensions/mgmt/host/service.py +++ b/trove/extensions/mgmt/host/service.py @@ -17,15 +17,15 @@ import webob.exc -from reddwarf.common import exception -from reddwarf.common import wsgi -from reddwarf.common.auth import admin_context -from reddwarf.extensions.mgmt.host import models -from reddwarf.extensions.mgmt.host import views -from reddwarf.extensions.mysql import models as mysql_models -from reddwarf.instance.service import InstanceController -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import wsgi +from trove.common.auth import admin_context +from trove.extensions.mgmt.host import models +from trove.extensions.mgmt.host import views +from trove.extensions.mysql import models as mysql_models +from trove.instance.service import InstanceController +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mgmt/host/views.py b/trove/extensions/mgmt/host/views.py similarity index 100% rename from reddwarf/extensions/mgmt/host/views.py rename to trove/extensions/mgmt/host/views.py diff --git a/reddwarf/extensions/mgmt/instances/__init__.py b/trove/extensions/mgmt/instances/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/instances/__init__.py rename to trove/extensions/mgmt/instances/__init__.py diff --git a/reddwarf/extensions/mgmt/instances/models.py b/trove/extensions/mgmt/instances/models.py similarity index 94% rename from reddwarf/extensions/mgmt/instances/models.py rename to trove/extensions/mgmt/instances/models.py index dc0bcbf6b1..2a76886a9e 100644 --- a/reddwarf/extensions/mgmt/instances/models.py +++ b/trove/extensions/mgmt/instances/models.py @@ -13,15 +13,15 @@ # under the License. import datetime -from reddwarf.common import cfg -from reddwarf.common import remote -from reddwarf.common import utils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.notifier import api as notifier -from reddwarf.instance import models as imodels -from reddwarf.instance.models import load_instance, InstanceServiceStatus -from reddwarf.instance import models as instance_models -from reddwarf.extensions.mysql import models as mysql_models +from trove.common import cfg +from trove.common import remote +from trove.common import utils +from trove.openstack.common import log as logging +from trove.openstack.common.notifier import api as notifier +from trove.instance import models as imodels +from trove.instance.models import load_instance, InstanceServiceStatus +from trove.instance import models as instance_models +from trove.extensions.mysql import models as mysql_models LOG = logging.getLogger(__name__) CONF = cfg.CONF @@ -156,7 +156,7 @@ def publish_exist_events(transformer, admin_context): for notification in notifications: notifier.notify(admin_context, CONF.host, - "reddwarf.instance.exists", + "trove.instance.exists", 'INFO', notification) diff --git a/reddwarf/extensions/mgmt/instances/service.py b/trove/extensions/mgmt/instances/service.py similarity index 90% rename from reddwarf/extensions/mgmt/instances/service.py rename to trove/extensions/mgmt/instances/service.py index cbeabafb2b..16b26ed017 100644 --- a/reddwarf/extensions/mgmt/instances/service.py +++ b/trove/extensions/mgmt/instances/service.py @@ -18,18 +18,18 @@ from novaclient import exceptions as nova_exceptions -from reddwarf.common import exception -from reddwarf.common import wsgi -from reddwarf.common.auth import admin_context -from reddwarf.instance import models as instance_models -from reddwarf.extensions.mgmt.instances import models -from reddwarf.extensions.mgmt.instances import views -from reddwarf.extensions.mgmt.instances.views import DiagnosticsView -from reddwarf.extensions.mgmt.instances.views import HwInfoView -from reddwarf.extensions.mysql import models as mysql_models -from reddwarf.instance.service import InstanceController -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import wsgi +from trove.common.auth import admin_context +from trove.instance import models as instance_models +from trove.extensions.mgmt.instances import models +from trove.extensions.mgmt.instances import views +from trove.extensions.mgmt.instances.views import DiagnosticsView +from trove.extensions.mgmt.instances.views import HwInfoView +from trove.extensions.mysql import models as mysql_models +from trove.instance.service import InstanceController +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) @@ -139,7 +139,7 @@ class MgmtInstanceController(InstanceController): context = req.environ[wsgi.CONTEXT_KEY] try: server = instance_models.Instance.load(context=context, id=id) - except exception.ReddwarfError, e: + except exception.TroveError, e: LOG.error(e) return wsgi.Result(str(e), 404) reh = mysql_models.RootHistory.load(context=context, instance_id=id) diff --git a/reddwarf/extensions/mgmt/instances/views.py b/trove/extensions/mgmt/instances/views.py similarity index 99% rename from reddwarf/extensions/mgmt/instances/views.py rename to trove/extensions/mgmt/instances/views.py index fda4070e8d..faaaf69db7 100644 --- a/reddwarf/extensions/mgmt/instances/views.py +++ b/trove/extensions/mgmt/instances/views.py @@ -16,7 +16,7 @@ # under the License. -from reddwarf.instance.views import InstanceDetailView +from trove.instance.views import InstanceDetailView class MgmtInstanceView(InstanceDetailView): diff --git a/reddwarf/extensions/mgmt/quota/__init__.py b/trove/extensions/mgmt/quota/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/quota/__init__.py rename to trove/extensions/mgmt/quota/__init__.py diff --git a/reddwarf/extensions/mgmt/quota/service.py b/trove/extensions/mgmt/quota/service.py similarity index 87% rename from reddwarf/extensions/mgmt/quota/service.py rename to trove/extensions/mgmt/quota/service.py index 038439c704..28c6e31b2c 100644 --- a/reddwarf/extensions/mgmt/quota/service.py +++ b/trove/extensions/mgmt/quota/service.py @@ -15,13 +15,13 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.common import wsgi -from reddwarf.common import exception -from reddwarf.common.auth import admin_context -from reddwarf.extensions.mgmt.quota import views -from reddwarf.openstack.common import log as logging -from reddwarf.quota.quota import QUOTAS as quota_engine -from reddwarf.quota.models import Quota +from trove.common import wsgi +from trove.common import exception +from trove.common.auth import admin_context +from trove.extensions.mgmt.quota import views +from trove.openstack.common import log as logging +from trove.quota.quota import QUOTAS as quota_engine +from trove.quota.models import Quota LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mgmt/quota/views.py b/trove/extensions/mgmt/quota/views.py similarity index 100% rename from reddwarf/extensions/mgmt/quota/views.py rename to trove/extensions/mgmt/quota/views.py diff --git a/reddwarf/extensions/mgmt/volume/__init__.py b/trove/extensions/mgmt/volume/__init__.py similarity index 100% rename from reddwarf/extensions/mgmt/volume/__init__.py rename to trove/extensions/mgmt/volume/__init__.py diff --git a/reddwarf/extensions/mgmt/volume/models.py b/trove/extensions/mgmt/volume/models.py similarity index 93% rename from reddwarf/extensions/mgmt/volume/models.py rename to trove/extensions/mgmt/volume/models.py index 3a35d50f7f..cd202ddf87 100644 --- a/reddwarf/extensions/mgmt/volume/models.py +++ b/trove/extensions/mgmt/volume/models.py @@ -19,9 +19,9 @@ Model classes that extend the instances functionality for volumes. """ -from reddwarf.openstack.common import log as logging +from trove.openstack.common import log as logging -from reddwarf.common.remote import create_nova_volume_client +from trove.common.remote import create_nova_volume_client LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mgmt/volume/service.py b/trove/extensions/mgmt/volume/service.py similarity index 78% rename from reddwarf/extensions/mgmt/volume/service.py rename to trove/extensions/mgmt/volume/service.py index 34a9b4ef18..9b7d70d3e4 100644 --- a/reddwarf/extensions/mgmt/volume/service.py +++ b/trove/extensions/mgmt/volume/service.py @@ -17,13 +17,13 @@ import webob.exc -from reddwarf.common import exception -from reddwarf.common import wsgi -from reddwarf.common.auth import admin_context -from reddwarf.extensions.mgmt.volume import models -from reddwarf.extensions.mgmt.volume import views -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import wsgi +from trove.common.auth import admin_context +from trove.extensions.mgmt.volume import models +from trove.extensions.mgmt.volume import views +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mgmt/volume/views.py b/trove/extensions/mgmt/volume/views.py similarity index 100% rename from reddwarf/extensions/mgmt/volume/views.py rename to trove/extensions/mgmt/volume/views.py diff --git a/reddwarf/extensions/mysql.py b/trove/extensions/mysql.py similarity index 83% rename from reddwarf/extensions/mysql.py rename to trove/extensions/mysql.py index 2b80d3b419..5bca7e4e19 100644 --- a/reddwarf/extensions/mysql.py +++ b/trove/extensions/mysql.py @@ -15,11 +15,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.common import extensions -from reddwarf.common import wsgi -from reddwarf.extensions.mysql import service +from trove.common import extensions +from trove.common import wsgi +from trove.extensions.mysql import service LOG = logging.getLogger(__name__) @@ -44,16 +44,16 @@ class Mysql(extensions.ExtensionsDescriptor): def get_resources(self): resources = [] - serializer = wsgi.ReddwarfResponseSerializer( + serializer = wsgi.TroveResponseSerializer( body_serializers={'application/xml': - wsgi.ReddwarfXMLDictSerializer()}) + wsgi.TroveXMLDictSerializer()}) resource = extensions.ResourceExtension( 'databases', service.SchemaController(), parent={'member_name': 'instance', 'collection_name': '{tenant_id}/instances'}, - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer) resources.append(resource) @@ -63,7 +63,7 @@ class Mysql(extensions.ExtensionsDescriptor): parent={'member_name': 'instance', 'collection_name': '{tenant_id}/instances'}, # deserializer=extensions.ExtensionsXMLSerializer() - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer, collection_actions={'update': 'PUT'}) resources.append(resource) @@ -74,7 +74,7 @@ class Mysql(extensions.ExtensionsDescriptor): service.UserAccessController(), parent={'member_name': 'user', 'collection_name': collection_url}, - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer, collection_actions={'update': 'PUT'}) resources.append(resource) @@ -84,7 +84,7 @@ class Mysql(extensions.ExtensionsDescriptor): service.RootController(), parent={'member_name': 'instance', 'collection_name': '{tenant_id}/instances'}, - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer) resources.append(resource) diff --git a/reddwarf/extensions/mysql/__init__.py b/trove/extensions/mysql/__init__.py similarity index 100% rename from reddwarf/extensions/mysql/__init__.py rename to trove/extensions/mysql/__init__.py diff --git a/reddwarf/extensions/mysql/common.py b/trove/extensions/mysql/common.py similarity index 95% rename from reddwarf/extensions/mysql/common.py rename to trove/extensions/mysql/common.py index 716cbfbfcd..4fee942e1d 100644 --- a/reddwarf/extensions/mysql/common.py +++ b/trove/extensions/mysql/common.py @@ -12,8 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.common import exception -from reddwarf.guestagent.db import models as guest_models +from trove.common import exception +from trove.guestagent.db import models as guest_models from urllib import unquote diff --git a/reddwarf/extensions/mysql/models.py b/trove/extensions/mysql/models.py similarity index 96% rename from reddwarf/extensions/mysql/models.py rename to trove/extensions/mysql/models.py index 6a21e7ec70..368be54ba5 100644 --- a/reddwarf/extensions/mysql/models.py +++ b/trove/extensions/mysql/models.py @@ -19,15 +19,15 @@ Model classes that extend the instances functionality for MySQL instances. """ -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.common.remote import create_guest_client -from reddwarf.db import get_db_api -from reddwarf.guestagent.db import models as guest_models -from reddwarf.instance import models as base_models -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import cfg +from trove.common import exception +from trove.common import utils +from trove.common.remote import create_guest_client +from trove.db import get_db_api +from trove.guestagent.db import models as guest_models +from trove.instance import models as base_models +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/reddwarf/extensions/mysql/service.py b/trove/extensions/mysql/service.py similarity index 95% rename from reddwarf/extensions/mysql/service.py rename to trove/extensions/mysql/service.py index eb38b728a9..b7f206484d 100644 --- a/reddwarf/extensions/mysql/service.py +++ b/trove/extensions/mysql/service.py @@ -17,17 +17,17 @@ import webob.exc -from reddwarf.common import exception -from reddwarf.common import pagination -from reddwarf.common import wsgi -from reddwarf.extensions.mysql.common import populate_validated_databases -from reddwarf.extensions.mysql.common import populate_users -from reddwarf.extensions.mysql.common import unquote_user_host -from reddwarf.extensions.mysql import models -from reddwarf.extensions.mysql import views -from reddwarf.guestagent.db import models as guest_models -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import pagination +from trove.common import wsgi +from trove.extensions.mysql.common import populate_validated_databases +from trove.extensions.mysql.common import populate_users +from trove.extensions.mysql.common import unquote_user_host +from trove.extensions.mysql import models +from trove.extensions.mysql import views +from trove.guestagent.db import models as guest_models +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ from urllib import unquote diff --git a/reddwarf/extensions/mysql/views.py b/trove/extensions/mysql/views.py similarity index 100% rename from reddwarf/extensions/mysql/views.py rename to trove/extensions/mysql/views.py diff --git a/reddwarf/extensions/security_group.py b/trove/extensions/security_group.py similarity index 80% rename from reddwarf/extensions/security_group.py rename to trove/extensions/security_group.py index f9bf816cf6..c943bbc8f2 100644 --- a/reddwarf/extensions/security_group.py +++ b/trove/extensions/security_group.py @@ -16,12 +16,12 @@ # under the License. # -from reddwarf.openstack.common import log as logging +from trove.openstack.common import log as logging -from reddwarf.common import extensions -from reddwarf.common import wsgi -from reddwarf.common import cfg -from reddwarf.extensions.security_group import service +from trove.common import extensions +from trove.common import wsgi +from trove.common import cfg +from trove.extensions.security_group import service LOG = logging.getLogger(__name__) @@ -51,22 +51,22 @@ security groups and manage security group rules." def get_resources(self): resources = [] - serializer = wsgi.ReddwarfResponseSerializer( + serializer = wsgi.TroveResponseSerializer( body_serializers={'application/xml': - wsgi.ReddwarfXMLDictSerializer()}) + wsgi.TroveXMLDictSerializer()}) - if CONF.reddwarf_security_groups_support: + if CONF.trove_security_groups_support: security_groups = extensions.ResourceExtension( '{tenant_id}/security-groups', service.SecurityGroupController(), - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer) resources.append(security_groups) security_group_rules = extensions.ResourceExtension( '{tenant_id}/security-group-rules', service.SecurityGroupRuleController(), - deserializer=wsgi.ReddwarfRequestDeserializer(), + deserializer=wsgi.TroveRequestDeserializer(), serializer=serializer) resources.append(security_group_rules) diff --git a/reddwarf/extensions/security_group/__init__.py b/trove/extensions/security_group/__init__.py similarity index 100% rename from reddwarf/extensions/security_group/__init__.py rename to trove/extensions/security_group/__init__.py diff --git a/reddwarf/extensions/security_group/models.py b/trove/extensions/security_group/models.py similarity index 91% rename from reddwarf/extensions/security_group/models.py rename to trove/extensions/security_group/models.py index bfaeed3ca0..ff59f12bf6 100644 --- a/reddwarf/extensions/security_group/models.py +++ b/trove/extensions/security_group/models.py @@ -19,13 +19,13 @@ """ Model classes for Security Groups and Security Group Rules on instances. """ -import reddwarf.common.remote -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.db.models import DatabaseModelBase -from reddwarf.common.models import NovaRemoteModelBase -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +import trove.common.remote +from trove.common import cfg +from trove.common import exception +from trove.db.models import DatabaseModelBase +from trove.common.models import NovaRemoteModelBase +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ from novaclient import exceptions as nova_exceptions @@ -110,9 +110,9 @@ class SecurityGroup(DatabaseModelBase): RemoteSecurityGroup.delete(self.id, context) super(SecurityGroup, self).delete() - except exception.ReddwarfError: + except exception.TroveError: LOG.exception('Failed to delete security group') - raise exception.ReddwarfError("Failed to delete Security Group") + raise exception.TroveError("Failed to delete Security Group") @classmethod def delete_for_instance(cls, instance_id, context): @@ -169,7 +169,7 @@ class SecurityGroupRule(DatabaseModelBase): # Delete Remote Security Group Rule RemoteSecurityGroup.delete_rule(self.id, context) super(SecurityGroupRule, self).delete() - except exception.ReddwarfError: + except exception.TroveError: LOG.exception('Failed to delete security group') raise exception.SecurityGroupRuleDeletionError( "Failed to delete Security Group") @@ -201,19 +201,19 @@ class RemoteSecurityGroup(NovaRemoteModelBase): raise exception.InvalidModelError(msg) elif security_group is None: try: - client = reddwarf.common.remote.create_nova_client(context) + client = trove.common.remote.create_nova_client(context) self._data_object = client.security_groups.get(id) except nova_exceptions.NotFound, e: raise exception.NotFound(id=id) except nova_exceptions.ClientException, e: - raise exception.ReddwarfError(str(e)) + raise exception.TroveError(str(e)) else: self._data_object = security_group @classmethod def create(cls, name, description, context): """Creates a new Security Group""" - client = reddwarf.common.remote.create_nova_client(context) + client = trove.common.remote.create_nova_client(context) try: sec_group = client.security_groups.create(name=name, description=description) @@ -225,7 +225,7 @@ class RemoteSecurityGroup(NovaRemoteModelBase): @classmethod def delete(cls, sec_group_id, context): - client = reddwarf.common.remote.create_nova_client(context) + client = trove.common.remote.create_nova_client(context) try: client.security_groups.delete(sec_group_id) @@ -237,7 +237,7 @@ class RemoteSecurityGroup(NovaRemoteModelBase): def add_rule(cls, sec_group_id, protocol, from_port, to_port, cidr, context): - client = reddwarf.common.remote.create_nova_client(context) + client = trove.common.remote.create_nova_client(context) try: sec_group_rule = client.security_group_rules.create( @@ -254,7 +254,7 @@ class RemoteSecurityGroup(NovaRemoteModelBase): @classmethod def delete_rule(cls, sec_group_rule_id, context): - client = reddwarf.common.remote.create_nova_client(context) + client = trove.common.remote.create_nova_client(context) try: client.security_group_rules.delete(sec_group_rule_id) diff --git a/reddwarf/extensions/security_group/service.py b/trove/extensions/security_group/service.py similarity index 89% rename from reddwarf/extensions/security_group/service.py rename to trove/extensions/security_group/service.py index 1da3bac4cf..515cc1788c 100644 --- a/reddwarf/extensions/security_group/service.py +++ b/trove/extensions/security_group/service.py @@ -17,13 +17,13 @@ # -from reddwarf.common import exception -from reddwarf.common import wsgi -from reddwarf.common import cfg -from reddwarf.extensions.security_group import models -from reddwarf.extensions.security_group import views -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import wsgi +from trove.common import cfg +from trove.extensions.security_group import models +from trove.extensions.security_group import views +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ CONF = cfg.CONF LOG = logging.getLogger(__name__) @@ -92,9 +92,9 @@ class SecurityGroupRuleController(wsgi.Controller): sec_group_rule = models.SecurityGroupRule.create_sec_group_rule( sec_group, - CONF.reddwarf_security_group_rule_protocol, - CONF.reddwarf_security_group_rule_port, - CONF.reddwarf_security_group_rule_port, + CONF.trove_security_group_rule_protocol, + CONF.trove_security_group_rule_port, + CONF.trove_security_group_rule_port, body['security_group_rule']['cidr'], context) diff --git a/reddwarf/extensions/security_group/views.py b/trove/extensions/security_group/views.py similarity index 98% rename from reddwarf/extensions/security_group/views.py rename to trove/extensions/security_group/views.py index 08c70d6e55..4005a9a962 100644 --- a/reddwarf/extensions/security_group/views.py +++ b/trove/extensions/security_group/views.py @@ -16,7 +16,7 @@ # under the License. # -from reddwarf.openstack.common import log as logging +from trove.openstack.common import log as logging import os LOG = logging.getLogger(__name__) diff --git a/reddwarf/flavor/__init__.py b/trove/flavor/__init__.py similarity index 100% rename from reddwarf/flavor/__init__.py rename to trove/flavor/__init__.py diff --git a/reddwarf/flavor/models.py b/trove/flavor/models.py similarity index 89% rename from reddwarf/flavor/models.py rename to trove/flavor/models.py index 39eedc217b..289c4454a8 100644 --- a/reddwarf/flavor/models.py +++ b/trove/flavor/models.py @@ -17,13 +17,13 @@ """Model classes that form the core of instance flavor functionality.""" -from reddwarf import db +from trove import db from novaclient import exceptions as nova_exceptions -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.common.models import NovaRemoteModelBase -from reddwarf.common.remote import create_nova_client +from trove.common import exception +from trove.common import utils +from trove.common.models import NovaRemoteModelBase +from trove.common.remote import create_nova_client class Flavor(object): @@ -41,7 +41,7 @@ class Flavor(object): except nova_exceptions.NotFound, e: raise exception.NotFound(uuid=flavor_id) except nova_exceptions.ClientException, e: - raise exception.ReddwarfError(str(e)) + raise exception.TroveError(str(e)) return msg = ("Flavor is not defined, and" " context and flavor_id were not specified.") diff --git a/reddwarf/flavor/service.py b/trove/flavor/service.py similarity index 90% rename from reddwarf/flavor/service.py rename to trove/flavor/service.py index 9e07972f6c..8c1aa19f57 100644 --- a/reddwarf/flavor/service.py +++ b/trove/flavor/service.py @@ -18,11 +18,11 @@ import routes import webob.exc -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.common import wsgi -from reddwarf.flavor import models -from reddwarf.flavor import views +from trove.common import exception +from trove.common import utils +from trove.common import wsgi +from trove.flavor import models +from trove.flavor import views class FlavorController(wsgi.Controller): diff --git a/reddwarf/flavor/views.py b/trove/flavor/views.py similarity index 90% rename from reddwarf/flavor/views.py rename to trove/flavor/views.py index 2c05969361..bbe8ad8076 100644 --- a/reddwarf/flavor/views.py +++ b/trove/flavor/views.py @@ -16,8 +16,8 @@ # under the License. -from reddwarf.common.views import create_links -from reddwarf.common import cfg +from trove.common.views import create_links +from trove.common import cfg CONF = cfg.CONF @@ -37,7 +37,7 @@ class FlavorView(object): 'ram': self.flavor.ram, } - if not CONF.reddwarf_volume_support and CONF.device_path is not None: + if not CONF.trove_volume_support and CONF.device_path is not None: flavor['local_storage'] = self.flavor.ephemeral return {"flavor": flavor} diff --git a/reddwarf/guestagent/__init__.py b/trove/guestagent/__init__.py similarity index 100% rename from reddwarf/guestagent/__init__.py rename to trove/guestagent/__init__.py diff --git a/reddwarf/guestagent/api.py b/trove/guestagent/api.py similarity index 96% rename from reddwarf/guestagent/api.py rename to trove/guestagent/api.py index 5f3b67350a..3ad9f03888 100644 --- a/reddwarf/guestagent/api.py +++ b/trove/guestagent/api.py @@ -21,14 +21,14 @@ Handles all request to the Platform or Guest VM from eventlet import Timeout -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common import rpc as rd_rpc -from reddwarf.guestagent import models as agent_models -from reddwarf.openstack.common import rpc -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.rpc import proxy -from reddwarf.openstack.common.gettextutils import _ +from trove.common import cfg +from trove.common import exception +from trove.common import rpc as rd_rpc +from trove.guestagent import models as agent_models +from trove.openstack.common import rpc +from trove.openstack.common import log as logging +from trove.openstack.common.rpc import proxy +from trove.openstack.common.gettextutils import _ CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/backup/__init__.py b/trove/guestagent/backup/__init__.py similarity index 93% rename from reddwarf/guestagent/backup/__init__.py rename to trove/guestagent/backup/__init__.py index a7085b3fbe..7fe47509b5 100644 --- a/reddwarf/guestagent/backup/__init__.py +++ b/trove/guestagent/backup/__init__.py @@ -1,4 +1,4 @@ -from reddwarf.guestagent.backup.backupagent import BackupAgent +from trove.guestagent.backup.backupagent import BackupAgent AGENT = BackupAgent() diff --git a/reddwarf/guestagent/backup/backupagent.py b/trove/guestagent/backup/backupagent.py similarity index 88% rename from reddwarf/guestagent/backup/backupagent.py rename to trove/guestagent/backup/backupagent.py index 7725993c35..884b55cf3d 100644 --- a/reddwarf/guestagent/backup/backupagent.py +++ b/trove/guestagent/backup/backupagent.py @@ -15,16 +15,16 @@ # import logging -from reddwarf.backup.models import DBBackup -from reddwarf.backup.models import BackupState -from reddwarf.common import cfg, utils -from reddwarf.guestagent.manager.mysql_service import ADMIN_USER_NAME -from reddwarf.guestagent.manager.mysql_service import get_auth_password -from reddwarf.guestagent.strategies.backup.base import BackupError -from reddwarf.guestagent.strategies.backup.base import UnknownBackupType -from reddwarf.guestagent.strategies.storage import get_storage_strategy -from reddwarf.guestagent.strategies.backup import get_backup_strategy -from reddwarf.guestagent.strategies.restore import get_restore_strategy +from trove.backup.models import DBBackup +from trove.backup.models import BackupState +from trove.common import cfg, utils +from trove.guestagent.manager.mysql_service import ADMIN_USER_NAME +from trove.guestagent.manager.mysql_service import get_auth_password +from trove.guestagent.strategies.backup.base import BackupError +from trove.guestagent.strategies.backup.base import UnknownBackupType +from trove.guestagent.strategies.storage import get_storage_strategy +from trove.guestagent.strategies.backup import get_backup_strategy +from trove.guestagent.strategies.restore import get_restore_strategy LOG = logging.getLogger(__name__) CONF = cfg.CONF diff --git a/reddwarf/guestagent/db/__init__.py b/trove/guestagent/db/__init__.py similarity index 100% rename from reddwarf/guestagent/db/__init__.py rename to trove/guestagent/db/__init__.py diff --git a/reddwarf/guestagent/db/models.py b/trove/guestagent/db/models.py similarity index 99% rename from reddwarf/guestagent/db/models.py rename to trove/guestagent/db/models.py index 53ea7e0df6..f723cbe02f 100644 --- a/reddwarf/guestagent/db/models.py +++ b/trove/guestagent/db/models.py @@ -18,7 +18,7 @@ import re import string -from reddwarf.common import cfg +from trove.common import cfg CONF = cfg.CONF diff --git a/reddwarf/guestagent/dbaas.py b/trove/guestagent/dbaas.py similarity index 89% rename from reddwarf/guestagent/dbaas.py rename to trove/guestagent/dbaas.py index 9d404413a0..5e698bb150 100644 --- a/reddwarf/guestagent/dbaas.py +++ b/trove/guestagent/dbaas.py @@ -26,14 +26,14 @@ handles RPC calls relating to Platform specific operations. """ -from reddwarf.common import utils -from reddwarf.openstack.common import log as logging +from trove.common import utils +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) SERVICE_REGISTRY = { - 'mysql': 'reddwarf.guestagent.manager.mysql.Manager', - 'percona': 'reddwarf.guestagent.manager.mysql.Manager', } + 'mysql': 'trove.guestagent.manager.mysql.Manager', + 'percona': 'trove.guestagent.manager.mysql.Manager', } class Interrogator(object): diff --git a/reddwarf/guestagent/manager/__init__.py b/trove/guestagent/manager/__init__.py similarity index 100% rename from reddwarf/guestagent/manager/__init__.py rename to trove/guestagent/manager/__init__.py diff --git a/reddwarf/guestagent/manager/mysql.py b/trove/guestagent/manager/mysql.py similarity index 90% rename from reddwarf/guestagent/manager/mysql.py rename to trove/guestagent/manager/mysql.py index e912509a58..4f5482751f 100644 --- a/reddwarf/guestagent/manager/mysql.py +++ b/trove/guestagent/manager/mysql.py @@ -1,15 +1,15 @@ import os -from reddwarf.common import cfg -from reddwarf.guestagent import dbaas -from reddwarf.guestagent import backup -from reddwarf.guestagent import volume -from reddwarf.guestagent.manager.mysql_service import MySqlAppStatus -from reddwarf.guestagent.manager.mysql_service import MySqlAdmin -from reddwarf.guestagent.manager.mysql_service import MySqlApp -from reddwarf.instance import models as rd_models -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import periodic_task +from trove.common import cfg +from trove.guestagent import dbaas +from trove.guestagent import backup +from trove.guestagent import volume +from trove.guestagent.manager.mysql_service import MySqlAppStatus +from trove.guestagent.manager.mysql_service import MySqlAdmin +from trove.guestagent.manager.mysql_service import MySqlApp +from trove.instance import models as rd_models +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import periodic_task LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/manager/mysql_service.py b/trove/guestagent/manager/mysql_service.py similarity index 98% rename from reddwarf/guestagent/manager/mysql_service.py rename to trove/guestagent/manager/mysql_service.py index 0b377622ca..f69347bf53 100644 --- a/reddwarf/guestagent/manager/mysql_service.py +++ b/trove/guestagent/manager/mysql_service.py @@ -9,16 +9,16 @@ from sqlalchemy import exc from sqlalchemy import interfaces from sqlalchemy.sql.expression import text -from reddwarf.common import cfg -from reddwarf.common import utils as utils -from reddwarf.common import exception -from reddwarf.guestagent import query -from reddwarf.guestagent.db import models -from reddwarf.guestagent import pkg -from reddwarf.instance import models as rd_models -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.extensions.mysql.models import RootHistory +from trove.common import cfg +from trove.common import utils as utils +from trove.common import exception +from trove.guestagent import query +from trove.guestagent.db import models +from trove.guestagent import pkg +from trove.instance import models as rd_models +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.extensions.mysql.models import RootHistory ADMIN_USER_NAME = "os_admin" LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/models.py b/trove/guestagent/models.py similarity index 86% rename from reddwarf/guestagent/models.py rename to trove/guestagent/models.py index 6515d085e6..a0cbb9a4c5 100644 --- a/reddwarf/guestagent/models.py +++ b/trove/guestagent/models.py @@ -15,13 +15,13 @@ from datetime import datetime from datetime import timedelta -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.db import get_db_api -from reddwarf.db import models as dbmodels -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import cfg +from trove.common import exception +from trove.common import utils +from trove.db import get_db_api +from trove.db import models as dbmodels +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/pkg.py b/trove/guestagent/pkg.py similarity index 94% rename from reddwarf/guestagent/pkg.py rename to trove/guestagent/pkg.py index 473d7fa2d4..49f927d4c2 100644 --- a/reddwarf/guestagent/pkg.py +++ b/trove/guestagent/pkg.py @@ -22,25 +22,25 @@ import commands import pexpect import re -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.common.exception import ProcessExecutionError -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import exception +from trove.common import utils +from trove.common.exception import ProcessExecutionError +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ LOG = logging.getLogger(__name__) -class PkgAdminLockError(exception.ReddwarfError): +class PkgAdminLockError(exception.TroveError): pass -class PkgPermissionError(exception.ReddwarfError): +class PkgPermissionError(exception.TroveError): pass -class PkgPackageStateError(exception.ReddwarfError): +class PkgPackageStateError(exception.TroveError): pass @@ -48,7 +48,7 @@ class PkgNotFoundError(exception.NotFound): pass -class PkgTimeout(exception.ReddwarfError): +class PkgTimeout(exception.TroveError): pass diff --git a/reddwarf/guestagent/query.py b/trove/guestagent/query.py similarity index 100% rename from reddwarf/guestagent/query.py rename to trove/guestagent/query.py diff --git a/reddwarf/guestagent/service.py b/trove/guestagent/service.py similarity index 93% rename from reddwarf/guestagent/service.py rename to trove/guestagent/service.py index 0bce4aeeaf..1d891cf33a 100644 --- a/reddwarf/guestagent/service.py +++ b/trove/guestagent/service.py @@ -15,11 +15,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 import routes import webob.exc -from reddwarf.common import wsgi +from trove.common import wsgi LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/__init__.py b/trove/guestagent/strategies/__init__.py similarity index 100% rename from reddwarf/guestagent/strategies/__init__.py rename to trove/guestagent/strategies/__init__.py diff --git a/reddwarf/guestagent/strategies/backup/__init__.py b/trove/guestagent/strategies/backup/__init__.py similarity index 89% rename from reddwarf/guestagent/strategies/backup/__init__.py rename to trove/guestagent/strategies/backup/__init__.py index 31da655862..0bf0d44e73 100644 --- a/reddwarf/guestagent/strategies/backup/__init__.py +++ b/trove/guestagent/strategies/backup/__init__.py @@ -14,8 +14,8 @@ # under the License. # -from reddwarf.guestagent.strategy import Strategy -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategy import Strategy +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/backup/base.py b/trove/guestagent/strategies/backup/base.py similarity index 95% rename from reddwarf/guestagent/strategies/backup/base.py rename to trove/guestagent/strategies/backup/base.py index 53e47e4c4b..53ae9596f4 100644 --- a/reddwarf/guestagent/strategies/backup/base.py +++ b/trove/guestagent/strategies/backup/base.py @@ -16,9 +16,9 @@ import hashlib -from reddwarf.guestagent.strategy import Strategy -from reddwarf.openstack.common import log as logging -from reddwarf.common import cfg, utils +from trove.guestagent.strategy import Strategy +from trove.openstack.common import log as logging +from trove.common import cfg, utils from eventlet.green import subprocess CONF = cfg.CONF @@ -47,7 +47,7 @@ class UnknownBackupType(Exception): class BackupRunner(Strategy): """ Base class for Backup Strategy implementations """ __strategy_type__ = 'backup_runner' - __strategy_ns__ = 'reddwarf.guestagent.strategies.backup' + __strategy_ns__ = 'trove.guestagent.strategies.backup' # The actual system call to run the backup cmd = None diff --git a/reddwarf/guestagent/strategies/backup/impl.py b/trove/guestagent/strategies/backup/impl.py similarity index 94% rename from reddwarf/guestagent/strategies/backup/impl.py rename to trove/guestagent/strategies/backup/impl.py index 8a2c0bc7b9..8555aa526f 100644 --- a/reddwarf/guestagent/strategies/backup/impl.py +++ b/trove/guestagent/strategies/backup/impl.py @@ -14,8 +14,8 @@ # under the License. # -from reddwarf.guestagent.strategies.backup import base -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategies.backup import base +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/restore/__init__.py b/trove/guestagent/strategies/restore/__init__.py similarity index 88% rename from reddwarf/guestagent/strategies/restore/__init__.py rename to trove/guestagent/strategies/restore/__init__.py index ae52776aa0..76f4c43fc1 100644 --- a/reddwarf/guestagent/strategies/restore/__init__.py +++ b/trove/guestagent/strategies/restore/__init__.py @@ -12,8 +12,8 @@ #See the License for the specific language governing permissions and #limitations under the License. -from reddwarf.guestagent.strategy import Strategy -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategy import Strategy +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/restore/base.py b/trove/guestagent/strategies/restore/base.py similarity index 96% rename from reddwarf/guestagent/strategies/restore/base.py rename to trove/guestagent/strategies/restore/base.py index 31dc6f14d8..d824b523f6 100644 --- a/reddwarf/guestagent/strategies/restore/base.py +++ b/trove/guestagent/strategies/restore/base.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. # -from reddwarf.guestagent.strategy import Strategy -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common import utils -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategy import Strategy +from trove.common import cfg +from trove.common import exception +from trove.common import utils +from trove.openstack.common import log as logging from eventlet.green import subprocess import tempfile import pexpect @@ -72,7 +72,7 @@ class RestoreRunner(Strategy): """Restore a database from a previous backup.""" __strategy_type__ = 'restore_runner' - __strategy_ns__ = 'reddwarf.guestagent.strategies.restore' + __strategy_ns__ = 'trove.guestagent.strategies.restore' # The actual system calls to run the restore and prepare restore_cmd = None diff --git a/reddwarf/guestagent/strategies/restore/impl.py b/trove/guestagent/strategies/restore/impl.py similarity index 90% rename from reddwarf/guestagent/strategies/restore/impl.py rename to trove/guestagent/strategies/restore/impl.py index 00d414d7a6..5119210e47 100644 --- a/reddwarf/guestagent/strategies/restore/impl.py +++ b/trove/guestagent/strategies/restore/impl.py @@ -14,10 +14,10 @@ # under the License. # -from reddwarf.guestagent.strategies.restore import base -from reddwarf.openstack.common import log as logging -from reddwarf.common import utils -import reddwarf.guestagent.manager.mysql_service as dbaas +from trove.guestagent.strategies.restore import base +from trove.openstack.common import log as logging +from trove.common import utils +import trove.guestagent.manager.mysql_service as dbaas LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/storage/__init__.py b/trove/guestagent/strategies/storage/__init__.py similarity index 89% rename from reddwarf/guestagent/strategies/storage/__init__.py rename to trove/guestagent/strategies/storage/__init__.py index 10e2b4a0bf..0785b9e598 100644 --- a/reddwarf/guestagent/strategies/storage/__init__.py +++ b/trove/guestagent/strategies/storage/__init__.py @@ -14,8 +14,8 @@ # under the License. # -from reddwarf.guestagent.strategy import Strategy -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategy import Strategy +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/strategies/storage/base.py b/trove/guestagent/strategies/storage/base.py similarity index 87% rename from reddwarf/guestagent/strategies/storage/base.py rename to trove/guestagent/strategies/storage/base.py index 2df9f7cb67..d6e447ed8b 100644 --- a/reddwarf/guestagent/strategies/storage/base.py +++ b/trove/guestagent/strategies/storage/base.py @@ -15,8 +15,8 @@ # import abc -from reddwarf.guestagent.strategy import Strategy -from reddwarf.openstack.common import log as logging +from trove.guestagent.strategy import Strategy +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -25,7 +25,7 @@ LOG = logging.getLogger(__name__) class Storage(Strategy): """ Base class for Storage Strategy implementation """ __strategy_type__ = 'storage' - __strategy_ns__ = 'reddwarf.guestagent.strategies.storage' + __strategy_ns__ = 'trove.guestagent.strategies.storage' def __init__(self): super(Storage, self).__init__() diff --git a/reddwarf/guestagent/strategies/storage/swift.py b/trove/guestagent/strategies/storage/swift.py similarity index 96% rename from reddwarf/guestagent/strategies/storage/swift.py rename to trove/guestagent/strategies/storage/swift.py index 3b8c2b53b1..a8b6876da5 100644 --- a/reddwarf/guestagent/strategies/storage/swift.py +++ b/trove/guestagent/strategies/storage/swift.py @@ -14,10 +14,10 @@ # under the License. # -from reddwarf.guestagent.strategies.storage import base -from reddwarf.openstack.common import log as logging -from reddwarf.common.remote import create_swift_client -from reddwarf.common import utils +from trove.guestagent.strategies.storage import base +from trove.openstack.common import log as logging +from trove.common.remote import create_swift_client +from trove.common import utils from eventlet.green import subprocess import zlib diff --git a/reddwarf/guestagent/strategy.py b/trove/guestagent/strategy.py similarity index 95% rename from reddwarf/guestagent/strategy.py rename to trove/guestagent/strategy.py index 471616c43c..218d0f09c5 100644 --- a/reddwarf/guestagent/strategy.py +++ b/trove/guestagent/strategy.py @@ -15,8 +15,8 @@ # import abc -from reddwarf.common import utils -from reddwarf.openstack.common import log as logging +from trove.common import utils +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/guestagent/volume.py b/trove/guestagent/volume.py similarity index 96% rename from reddwarf/guestagent/volume.py rename to trove/guestagent/volume.py index 9861b62416..2536eca80e 100644 --- a/reddwarf/guestagent/volume.py +++ b/trove/guestagent/volume.py @@ -15,14 +15,14 @@ # 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 import pexpect -from reddwarf.common import cfg -from reddwarf.common import utils -from reddwarf.common.exception import GuestError -from reddwarf.common.exception import ProcessExecutionError +from trove.common import cfg +from trove.common import utils +from trove.common.exception import GuestError +from trove.common.exception import ProcessExecutionError TMP_MOUNT_POINT = "/mnt/volume" diff --git a/reddwarf/instance/__init__.py b/trove/instance/__init__.py similarity index 100% rename from reddwarf/instance/__init__.py rename to trove/instance/__init__.py diff --git a/reddwarf/instance/models.py b/trove/instance/models.py similarity index 95% rename from reddwarf/instance/models.py rename to trove/instance/models.py index 61633afbd8..191d77d574 100644 --- a/reddwarf/instance/models.py +++ b/trove/instance/models.py @@ -19,21 +19,21 @@ from datetime import datetime from novaclient import exceptions as nova_exceptions -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common.remote import create_dns_client -from reddwarf.common.remote import create_guest_client -from reddwarf.common.remote import create_nova_client -from reddwarf.common.remote import create_nova_volume_client -from reddwarf.extensions.security_group.models import SecurityGroup -from reddwarf.db import models as dbmodels -from reddwarf.backup.models import Backup -from reddwarf.quota.quota import run_with_quotas -from reddwarf.instance.tasks import InstanceTask -from reddwarf.instance.tasks import InstanceTasks -from reddwarf.taskmanager import api as task_api -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import cfg +from trove.common import exception +from trove.common.remote import create_dns_client +from trove.common.remote import create_guest_client +from trove.common.remote import create_nova_client +from trove.common.remote import create_nova_volume_client +from trove.extensions.security_group.models import SecurityGroup +from trove.db import models as dbmodels +from trove.backup.models import Backup +from trove.quota.quota import run_with_quotas +from trove.instance.tasks import InstanceTask +from trove.instance.tasks import InstanceTasks +from trove.taskmanager import api as task_api +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ CONF = cfg.CONF @@ -50,7 +50,7 @@ def load_server(context, instance_id, server_id): raise exception.ComputeInstanceNotFound(instance_id=instance_id, server_id=server_id) except nova_exceptions.ClientException, e: - raise exception.ReddwarfError(str(e)) + raise exception.TroveError(str(e)) return server @@ -337,7 +337,7 @@ class BaseInstance(SimpleInstance): task_api.API(self.context).delete_instance(self.id) deltas = {'instances': -1} - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: deltas['volumes'] = -self.volume_size return run_with_quotas(self.tenant_id, deltas, @@ -359,7 +359,7 @@ class BaseInstance(SimpleInstance): self.update_db(deleted=True, deleted_at=time_now, task_status=InstanceTasks.NONE) # Delete associated security group - if CONF.reddwarf_security_groups_support: + if CONF.trove_security_groups_support: SecurityGroup.delete_for_instance(self.db_info.id, self.context) @@ -424,7 +424,7 @@ class Instance(BuiltInstance): raise exception.FlavorNotFound(uuid=flavor_id) deltas = {'instances': 1} - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: validate_volume_size(volume_size) deltas['volumes'] = volume_size else: @@ -451,20 +451,20 @@ class Instance(BuiltInstance): tenant_id=context.tenant, volume_size=volume_size, task_status=InstanceTasks.BUILDING) - LOG.debug(_("Tenant %s created new Reddwarf instance %s...") + LOG.debug(_("Tenant %s created new Trove instance %s...") % (context.tenant, db_info.id)) service_status = InstanceServiceStatus.create( instance_id=db_info.id, status=ServiceStatuses.NEW) - if CONF.reddwarf_dns_support: + if CONF.trove_dns_support: dns_client = create_dns_client(context) hostname = dns_client.determine_hostname(db_info.id) db_info.hostname = hostname db_info.save() - if CONF.reddwarf_security_groups_support: + if CONF.trove_security_groups_support: security_group = SecurityGroup.create_for_instance( db_info.id, context) @@ -496,7 +496,7 @@ class Instance(BuiltInstance): old_flavor = client.flavors.get(self.flavor_id) new_flavor_size = new_flavor.ram old_flavor_size = old_flavor.ram - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: if new_flavor.ephemeral != 0: raise exception.LocalStorageNotSupported() if new_flavor_size == old_flavor_size: @@ -595,14 +595,14 @@ def create_server_list_matcher(server_list): elif len(matches) < 1: # The instance was not found in the list and # this can happen if the instance is deleted from - # nova but still in reddwarf database + # nova but still in trove database raise exception.ComputeInstanceNotFound( instance_id=instance_id, server_id=server_id) else: # Should never happen, but never say never. LOG.error(_("Server %s for instance %s was found twice!") % (server_id, instance_id)) - raise exception.ReddwarfError(uuid=instance_id) + raise exception.TroveError(uuid=instance_id) return find_server diff --git a/reddwarf/instance/service.py b/trove/instance/service.py similarity index 91% rename from reddwarf/instance/service.py rename to trove/instance/service.py index 645fea2a3b..b4c19e7eff 100644 --- a/reddwarf/instance/service.py +++ b/trove/instance/service.py @@ -17,18 +17,18 @@ import webob.exc -from reddwarf.common import cfg -from reddwarf.common import exception -from reddwarf.common import pagination -from reddwarf.common import utils -from reddwarf.common import wsgi -from reddwarf.extensions.mysql.common import populate_validated_databases -from reddwarf.extensions.mysql.common import populate_users -from reddwarf.instance import models, views -from reddwarf.backup.models import Backup as backup_model -from reddwarf.backup import views as backup_views -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.common import cfg +from trove.common import exception +from trove.common import pagination +from trove.common import utils +from trove.common import wsgi +from trove.extensions.mysql.common import populate_validated_databases +from trove.extensions.mysql.common import populate_users +from trove.instance import models, views +from trove.backup.models import Backup as backup_model +from trove.backup import views as backup_views +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ CONF = cfg.CONF @@ -225,7 +225,7 @@ class InstanceController(wsgi.Controller): """Check that the body is not empty""" if not body: msg = "The request contains an empty body" - raise exception.ReddwarfError(msg) + raise exception.TroveError(msg) @staticmethod def _validate_resize_volume(volume): @@ -246,12 +246,12 @@ class InstanceController(wsgi.Controller): LOG.error(err) msg = ("Required element/key - instance volume 'size' was not " "specified as a number (value was %s)." % size) - raise exception.ReddwarfError(msg) + raise exception.TroveError(msg) if int(volume_size) != volume_size or int(volume_size) < 1: msg = ("Volume 'size' needs to be a positive " "integer value, %s cannot be accepted." % volume_size) - raise exception.ReddwarfError(msg) + raise exception.TroveError(msg) @staticmethod def _validate(body): @@ -264,7 +264,7 @@ class InstanceController(wsgi.Controller): name = body['instance'].get('name', '').strip() if not name: raise exception.MissingKey(key='name') - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: if body['instance'].get('volume', None): if body['instance']['volume'].get('size', None): volume_size = body['instance']['volume']['size'] @@ -276,5 +276,5 @@ class InstanceController(wsgi.Controller): except KeyError as e: LOG.error(_("Create Instance Required field(s) - %s") % e) - raise exception.ReddwarfError("Required element/key - %s " - "was not specified" % e) + raise exception.TroveError("Required element/key - %s " + "was not specified" % e) diff --git a/reddwarf/instance/tasks.py b/trove/instance/tasks.py similarity index 98% rename from reddwarf/instance/tasks.py rename to trove/instance/tasks.py index 4053b79097..4d2470f61a 100644 --- a/reddwarf/instance/tasks.py +++ b/trove/instance/tasks.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. """ -Common instance status code used across Reddwarf API. +Common instance status code used across Trove API. """ diff --git a/reddwarf/instance/views.py b/trove/instance/views.py similarity index 91% rename from reddwarf/instance/views.py rename to trove/instance/views.py index 4969699182..f1d7a601a6 100644 --- a/reddwarf/instance/views.py +++ b/trove/instance/views.py @@ -15,11 +15,11 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.openstack.common import log as logging -from reddwarf.common import cfg -from reddwarf.common import utils -from reddwarf.common.views import create_links -from reddwarf.instance import models +from trove.openstack.common import log as logging +from trove.common import cfg +from trove.common import utils +from trove.common.views import create_links +from trove.instance import models LOG = logging.getLogger(__name__) @@ -52,7 +52,7 @@ class InstanceView(object): "links": self._build_links(), "flavor": self._build_flavor_info(), } - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: instance_dict['volume'] = {'size': self.instance.volume_size} LOG.debug(instance_dict) return {"instance": instance_dict} @@ -86,7 +86,7 @@ class InstanceDetailView(InstanceView): result['instance']['created'] = self.instance.created result['instance']['updated'] = self.instance.updated - dns_support = CONF.reddwarf_dns_support + dns_support = CONF.trove_dns_support if dns_support: result['instance']['hostname'] = self.instance.hostname @@ -94,7 +94,7 @@ class InstanceDetailView(InstanceView): ip = get_ip_address(self.instance.addresses) if ip is not None and len(ip) > 0: result['instance']['ip'] = ip - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: if (isinstance(self.instance, models.DetailInstance) and self.instance.volume_used): used = self._to_gb(self.instance.volume_used) diff --git a/reddwarf/limits/__init__.py b/trove/limits/__init__.py similarity index 100% rename from reddwarf/limits/__init__.py rename to trove/limits/__init__.py diff --git a/reddwarf/limits/service.py b/trove/limits/service.py similarity index 87% rename from reddwarf/limits/service.py rename to trove/limits/service.py index eb90b5a504..1918aba483 100644 --- a/reddwarf/limits/service.py +++ b/trove/limits/service.py @@ -15,9 +15,9 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.common import wsgi -from reddwarf.limits import views -from reddwarf.quota.quota import QUOTAS +from trove.common import wsgi +from trove.limits import views +from trove.quota.quota import QUOTAS class LimitsController(wsgi.Controller): @@ -31,7 +31,7 @@ class LimitsController(wsgi.Controller): """ quotas = QUOTAS.get_all_quotas_by_tenant(tenant_id) abs_limits = dict((k, v['hard_limit']) for k, v in quotas.items()) - rate_limits = req.environ.get("reddwarf.limits", []) + rate_limits = req.environ.get("trove.limits", []) return wsgi.Result(views.LimitViews(abs_limits, rate_limits).data(), 200) diff --git a/reddwarf/limits/views.py b/trove/limits/views.py similarity index 97% rename from reddwarf/limits/views.py rename to trove/limits/views.py index 28dd63144a..294a43d5b2 100644 --- a/reddwarf/limits/views.py +++ b/trove/limits/views.py @@ -16,7 +16,7 @@ # under the License. import datetime -from reddwarf.openstack.common import timeutils +from trove.openstack.common import timeutils class LimitView(object): diff --git a/reddwarf/openstack/__init__.py b/trove/openstack/__init__.py similarity index 100% rename from reddwarf/openstack/__init__.py rename to trove/openstack/__init__.py diff --git a/reddwarf/openstack/common/README b/trove/openstack/common/README similarity index 100% rename from reddwarf/openstack/common/README rename to trove/openstack/common/README diff --git a/reddwarf/openstack/common/__init__.py b/trove/openstack/common/__init__.py similarity index 100% rename from reddwarf/openstack/common/__init__.py rename to trove/openstack/common/__init__.py diff --git a/reddwarf/openstack/common/config.py b/trove/openstack/common/config.py similarity index 100% rename from reddwarf/openstack/common/config.py rename to trove/openstack/common/config.py diff --git a/reddwarf/openstack/common/context.py b/trove/openstack/common/context.py similarity index 98% rename from reddwarf/openstack/common/context.py rename to trove/openstack/common/context.py index 2fe123181d..3b6199238e 100644 --- a/reddwarf/openstack/common/context.py +++ b/trove/openstack/common/context.py @@ -24,7 +24,7 @@ context or provide additional information in their specific WSGI pipeline. import itertools -from reddwarf.openstack.common import uuidutils +from trove.openstack.common import uuidutils def generate_request_id(): diff --git a/reddwarf/openstack/common/eventlet_backdoor.py b/trove/openstack/common/eventlet_backdoor.py similarity index 100% rename from reddwarf/openstack/common/eventlet_backdoor.py rename to trove/openstack/common/eventlet_backdoor.py diff --git a/reddwarf/openstack/common/exception.py b/trove/openstack/common/exception.py similarity index 98% rename from reddwarf/openstack/common/exception.py rename to trove/openstack/common/exception.py index 813d4b8ae5..b14c4613a1 100644 --- a/reddwarf/openstack/common/exception.py +++ b/trove/openstack/common/exception.py @@ -21,7 +21,7 @@ Exceptions common to OpenStack projects import logging -from reddwarf.openstack.common.gettextutils import _ +from trove.openstack.common.gettextutils import _ _FATAL_EXCEPTION_FORMAT_ERRORS = False diff --git a/reddwarf/openstack/common/excutils.py b/trove/openstack/common/excutils.py similarity index 97% rename from reddwarf/openstack/common/excutils.py rename to trove/openstack/common/excutils.py index 8650bd6a18..baecc41f45 100644 --- a/reddwarf/openstack/common/excutils.py +++ b/trove/openstack/common/excutils.py @@ -24,7 +24,7 @@ import logging import sys import traceback -from reddwarf.openstack.common.gettextutils import _ +from trove.openstack.common.gettextutils import _ @contextlib.contextmanager diff --git a/reddwarf/openstack/common/extensions.py b/trove/openstack/common/extensions.py similarity index 99% rename from reddwarf/openstack/common/extensions.py rename to trove/openstack/common/extensions.py index ebb97aa5d2..da1e0e7b30 100644 --- a/reddwarf/openstack/common/extensions.py +++ b/trove/openstack/common/extensions.py @@ -24,8 +24,8 @@ import webob.exc import logging from lxml import etree -from reddwarf.openstack.common import exception -from reddwarf.openstack.common import wsgi +from trove.openstack.common import exception +from trove.openstack.common import wsgi LOG = logging.getLogger('extensions') DEFAULT_XMLNS = "http://docs.openstack.org/" diff --git a/reddwarf/openstack/common/fileutils.py b/trove/openstack/common/fileutils.py similarity index 100% rename from reddwarf/openstack/common/fileutils.py rename to trove/openstack/common/fileutils.py diff --git a/reddwarf/openstack/common/gettextutils.py b/trove/openstack/common/gettextutils.py similarity index 87% rename from reddwarf/openstack/common/gettextutils.py rename to trove/openstack/common/gettextutils.py index d85bcbdbe3..79ebd352e3 100644 --- a/reddwarf/openstack/common/gettextutils.py +++ b/trove/openstack/common/gettextutils.py @@ -20,14 +20,14 @@ gettext for openstack-common modules. Usual usage in an openstack.common module: - from reddwarf.openstack.common.gettextutils import _ + from trove.openstack.common.gettextutils import _ """ import gettext import os -_localedir = os.environ.get('reddwarf'.upper() + '_LOCALEDIR') -_t = gettext.translation('reddwarf', localedir=_localedir, fallback=True) +_localedir = os.environ.get('trove'.upper() + '_LOCALEDIR') +_t = gettext.translation('trove', localedir=_localedir, fallback=True) def _(msg): diff --git a/reddwarf/openstack/common/importutils.py b/trove/openstack/common/importutils.py similarity index 100% rename from reddwarf/openstack/common/importutils.py rename to trove/openstack/common/importutils.py diff --git a/reddwarf/openstack/common/iniparser.py b/trove/openstack/common/iniparser.py similarity index 100% rename from reddwarf/openstack/common/iniparser.py rename to trove/openstack/common/iniparser.py diff --git a/reddwarf/openstack/common/jsonutils.py b/trove/openstack/common/jsonutils.py similarity index 99% rename from reddwarf/openstack/common/jsonutils.py rename to trove/openstack/common/jsonutils.py index 58bc0dbf24..eb589da9a7 100644 --- a/reddwarf/openstack/common/jsonutils.py +++ b/trove/openstack/common/jsonutils.py @@ -43,7 +43,7 @@ import xmlrpclib #import six -from reddwarf.openstack.common import timeutils +from trove.openstack.common import timeutils _nasty_type_tests = [inspect.ismodule, inspect.isclass, inspect.ismethod, diff --git a/reddwarf/openstack/common/local.py b/trove/openstack/common/local.py similarity index 100% rename from reddwarf/openstack/common/local.py rename to trove/openstack/common/local.py diff --git a/reddwarf/openstack/common/lockutils.py b/trove/openstack/common/lockutils.py similarity index 98% rename from reddwarf/openstack/common/lockutils.py rename to trove/openstack/common/lockutils.py index 28889f2d5b..e0f5a44079 100644 --- a/reddwarf/openstack/common/lockutils.py +++ b/trove/openstack/common/lockutils.py @@ -27,9 +27,9 @@ import weakref from eventlet import semaphore from oslo.config import cfg -from reddwarf.openstack.common import fileutils -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging +from trove.openstack.common import fileutils +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/log.py b/trove/openstack/common/log.py similarity index 98% rename from reddwarf/openstack/common/log.py rename to trove/openstack/common/log.py index 76821b14e2..f26d05f97b 100644 --- a/reddwarf/openstack/common/log.py +++ b/trove/openstack/common/log.py @@ -42,10 +42,10 @@ import traceback from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import local -from reddwarf.openstack.common import notifier +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import jsonutils +from trove.openstack.common import local +from trove.openstack.common import notifier _DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" @@ -324,7 +324,7 @@ class JSONFormatter(logging.Formatter): class PublishErrorsHandler(logging.Handler): def emit(self, record): - if ('reddwarf.openstack.common.notifier.log_notifier' in + if ('trove.openstack.common.notifier.log_notifier' in CONF.notification_driver): return notifier.api.notify(None, 'error.publisher', diff --git a/reddwarf/openstack/common/loopingcall.py b/trove/openstack/common/loopingcall.py similarity index 96% rename from reddwarf/openstack/common/loopingcall.py rename to trove/openstack/common/loopingcall.py index 007f7b6579..c18771c243 100644 --- a/reddwarf/openstack/common/loopingcall.py +++ b/trove/openstack/common/loopingcall.py @@ -22,9 +22,9 @@ import sys from eventlet import event from eventlet import greenthread -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import timeutils +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/middleware/__init__.py b/trove/openstack/common/middleware/__init__.py similarity index 100% rename from reddwarf/openstack/common/middleware/__init__.py rename to trove/openstack/common/middleware/__init__.py diff --git a/reddwarf/openstack/common/middleware/context.py b/trove/openstack/common/middleware/context.py similarity index 93% rename from reddwarf/openstack/common/middleware/context.py rename to trove/openstack/common/middleware/context.py index 7a586c1c8e..57409cdf30 100644 --- a/reddwarf/openstack/common/middleware/context.py +++ b/trove/openstack/common/middleware/context.py @@ -19,9 +19,9 @@ Middleware that attaches a context to the WSGI request """ -from reddwarf.openstack.common import context -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import wsgi +from trove.openstack.common import context +from trove.openstack.common import importutils +from trove.openstack.common import wsgi class ContextMiddleware(wsgi.Middleware): diff --git a/reddwarf/openstack/common/network_utils.py b/trove/openstack/common/network_utils.py similarity index 97% rename from reddwarf/openstack/common/network_utils.py rename to trove/openstack/common/network_utils.py index 69ca28d105..96bccb18c0 100644 --- a/reddwarf/openstack/common/network_utils.py +++ b/trove/openstack/common/network_utils.py @@ -19,7 +19,7 @@ Network-related utilities and helper functions. """ -from reddwarf.openstack.common import log as logging +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/notifier/__init__.py b/trove/openstack/common/notifier/__init__.py similarity index 100% rename from reddwarf/openstack/common/notifier/__init__.py rename to trove/openstack/common/notifier/__init__.py diff --git a/reddwarf/openstack/common/notifier/api.py b/trove/openstack/common/notifier/api.py similarity index 94% rename from reddwarf/openstack/common/notifier/api.py rename to trove/openstack/common/notifier/api.py index e231a628e9..4dee3f0a80 100644 --- a/reddwarf/openstack/common/notifier/api.py +++ b/trove/openstack/common/notifier/api.py @@ -17,12 +17,12 @@ import uuid from oslo.config import cfg -from reddwarf.openstack.common import context -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import timeutils +from trove.openstack.common import context +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import jsonutils +from trove.openstack.common import log as logging +from trove.openstack.common import timeutils LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/notifier/log_notifier.py b/trove/openstack/common/notifier/log_notifier.py similarity index 87% rename from reddwarf/openstack/common/notifier/log_notifier.py rename to trove/openstack/common/notifier/log_notifier.py index 9c04d43576..3a220da8a0 100644 --- a/reddwarf/openstack/common/notifier/log_notifier.py +++ b/trove/openstack/common/notifier/log_notifier.py @@ -15,8 +15,8 @@ from oslo.config import cfg -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import log as logging +from trove.openstack.common import jsonutils +from trove.openstack.common import log as logging CONF = cfg.CONF @@ -30,6 +30,6 @@ def notify(_context, message): CONF.default_notification_level) priority = priority.lower() logger = logging.getLogger( - 'reddwarf.openstack.common.notification.%s' % + 'trove.openstack.common.notification.%s' % message['event_type']) getattr(logger, priority)(jsonutils.dumps(message)) diff --git a/reddwarf/openstack/common/notifier/no_op_notifier.py b/trove/openstack/common/notifier/no_op_notifier.py similarity index 100% rename from reddwarf/openstack/common/notifier/no_op_notifier.py rename to trove/openstack/common/notifier/no_op_notifier.py diff --git a/reddwarf/openstack/common/notifier/rabbit_notifier.py b/trove/openstack/common/notifier/rabbit_notifier.py similarity index 84% rename from reddwarf/openstack/common/notifier/rabbit_notifier.py rename to trove/openstack/common/notifier/rabbit_notifier.py index 7859903306..8702086a90 100644 --- a/reddwarf/openstack/common/notifier/rabbit_notifier.py +++ b/trove/openstack/common/notifier/rabbit_notifier.py @@ -14,9 +14,9 @@ # under the License. -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.notifier import rpc_notifier +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common.notifier import rpc_notifier LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/notifier/rpc_notifier.py b/trove/openstack/common/notifier/rpc_notifier.py similarity index 87% rename from reddwarf/openstack/common/notifier/rpc_notifier.py rename to trove/openstack/common/notifier/rpc_notifier.py index 667d5223f2..e057c07bb2 100644 --- a/reddwarf/openstack/common/notifier/rpc_notifier.py +++ b/trove/openstack/common/notifier/rpc_notifier.py @@ -15,10 +15,10 @@ from oslo.config import cfg -from reddwarf.openstack.common import context as req_context -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import rpc +from trove.openstack.common import context as req_context +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common import rpc LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/notifier/rpc_notifier2.py b/trove/openstack/common/notifier/rpc_notifier2.py similarity index 89% rename from reddwarf/openstack/common/notifier/rpc_notifier2.py rename to trove/openstack/common/notifier/rpc_notifier2.py index 524144820c..2f740f867e 100644 --- a/reddwarf/openstack/common/notifier/rpc_notifier2.py +++ b/trove/openstack/common/notifier/rpc_notifier2.py @@ -17,10 +17,10 @@ from oslo.config import cfg -from reddwarf.openstack.common import context as req_context -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import rpc +from trove.openstack.common import context as req_context +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common import rpc LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/notifier/test_notifier.py b/trove/openstack/common/notifier/test_notifier.py similarity index 100% rename from reddwarf/openstack/common/notifier/test_notifier.py rename to trove/openstack/common/notifier/test_notifier.py diff --git a/reddwarf/openstack/common/pastedeploy.py b/trove/openstack/common/pastedeploy.py similarity index 99% rename from reddwarf/openstack/common/pastedeploy.py rename to trove/openstack/common/pastedeploy.py index 8932d13ea7..b2f343df1a 100644 --- a/reddwarf/openstack/common/pastedeploy.py +++ b/trove/openstack/common/pastedeploy.py @@ -18,7 +18,7 @@ import sys from paste import deploy -from reddwarf.openstack.common import local +from trove.openstack.common import local class BasePasteFactory(object): diff --git a/reddwarf/openstack/common/periodic_task.py b/trove/openstack/common/periodic_task.py similarity index 97% rename from reddwarf/openstack/common/periodic_task.py rename to trove/openstack/common/periodic_task.py index 3dc9728b6f..4abfe96653 100644 --- a/reddwarf/openstack/common/periodic_task.py +++ b/trove/openstack/common/periodic_task.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/policy.py b/trove/openstack/common/policy.py similarity index 99% rename from reddwarf/openstack/common/policy.py rename to trove/openstack/common/policy.py index 5fa0d831e4..a10127e842 100644 --- a/reddwarf/openstack/common/policy.py +++ b/trove/openstack/common/policy.py @@ -63,8 +63,8 @@ import urllib import urllib2 -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import jsonutils +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import jsonutils LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/processutils.py b/trove/openstack/common/processutils.py similarity index 98% rename from reddwarf/openstack/common/processutils.py rename to trove/openstack/common/processutils.py index 4636b66a51..f1141f5e6d 100644 --- a/reddwarf/openstack/common/processutils.py +++ b/trove/openstack/common/processutils.py @@ -27,8 +27,8 @@ import signal from eventlet.green import subprocess from eventlet import greenthread -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/rpc/__init__.py b/trove/openstack/common/rpc/__init__.py similarity index 97% rename from reddwarf/openstack/common/rpc/__init__.py rename to trove/openstack/common/rpc/__init__.py index c0ba6dd333..e4807bb190 100644 --- a/reddwarf/openstack/common/rpc/__init__.py +++ b/trove/openstack/common/rpc/__init__.py @@ -29,10 +29,10 @@ import inspect from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import local -from reddwarf.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import local +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) @@ -56,7 +56,7 @@ rpc_opts = [ help='Seconds to wait before a cast expires (TTL). ' 'Only supported by impl_zmq.'), cfg.ListOpt('allowed_rpc_exception_modules', - default=['reddwarf.openstack.common.exception', + default=['trove.openstack.common.exception', 'nova.exception', 'cinder.exception', 'exceptions', diff --git a/reddwarf/openstack/common/rpc/amqp.py b/trove/openstack/common/rpc/amqp.py similarity index 98% rename from reddwarf/openstack/common/rpc/amqp.py rename to trove/openstack/common/rpc/amqp.py index 0036b45000..a271a73dca 100644 --- a/reddwarf/openstack/common/rpc/amqp.py +++ b/trove/openstack/common/rpc/amqp.py @@ -39,11 +39,11 @@ from eventlet import semaphore # option is removed. from oslo.config import cfg -from reddwarf.openstack.common import excutils -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import local -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common import excutils +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import local +from trove.openstack.common import log as logging +from trove.openstack.common.rpc import common as rpc_common # TODO(pekowski): Remove this option in Havana. diff --git a/reddwarf/openstack/common/rpc/common.py b/trove/openstack/common/rpc/common.py similarity index 98% rename from reddwarf/openstack/common/rpc/common.py rename to trove/openstack/common/rpc/common.py index 15149a710d..fee7082a89 100644 --- a/reddwarf/openstack/common/rpc/common.py +++ b/trove/openstack/common/rpc/common.py @@ -24,11 +24,11 @@ import traceback from oslo.config import cfg #import six -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import local -from reddwarf.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import jsonutils +from trove.openstack.common import local +from trove.openstack.common import log as logging CONF = cfg.CONF diff --git a/reddwarf/openstack/common/rpc/dispatcher.py b/trove/openstack/common/rpc/dispatcher.py similarity index 98% rename from reddwarf/openstack/common/rpc/dispatcher.py rename to trove/openstack/common/rpc/dispatcher.py index 46cef46595..f121e0be53 100644 --- a/reddwarf/openstack/common/rpc/dispatcher.py +++ b/trove/openstack/common/rpc/dispatcher.py @@ -83,7 +83,7 @@ On the client side, the same changes should be made as in example 1. The minimum version that supports the new parameter should be specified. """ -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common.rpc import common as rpc_common class RpcDispatcher(object): diff --git a/reddwarf/openstack/common/rpc/impl_fake.py b/trove/openstack/common/rpc/impl_fake.py similarity index 98% rename from reddwarf/openstack/common/rpc/impl_fake.py rename to trove/openstack/common/rpc/impl_fake.py index 65965d8e99..4a4c6ad1f5 100644 --- a/reddwarf/openstack/common/rpc/impl_fake.py +++ b/trove/openstack/common/rpc/impl_fake.py @@ -27,7 +27,7 @@ import time import eventlet -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common.rpc import common as rpc_common CONSUMERS = {} diff --git a/reddwarf/openstack/common/rpc/impl_kombu.py b/trove/openstack/common/rpc/impl_kombu.py similarity index 99% rename from reddwarf/openstack/common/rpc/impl_kombu.py rename to trove/openstack/common/rpc/impl_kombu.py index 589852c1b7..881627dd79 100644 --- a/reddwarf/openstack/common/rpc/impl_kombu.py +++ b/trove/openstack/common/rpc/impl_kombu.py @@ -30,10 +30,10 @@ import kombu.entity import kombu.messaging from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import network_utils -from reddwarf.openstack.common.rpc import amqp as rpc_amqp -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import network_utils +from trove.openstack.common.rpc import amqp as rpc_amqp +from trove.openstack.common.rpc import common as rpc_common kombu_opts = [ cfg.StrOpt('kombu_ssl_version', diff --git a/reddwarf/openstack/common/rpc/impl_qpid.py b/trove/openstack/common/rpc/impl_qpid.py similarity index 98% rename from reddwarf/openstack/common/rpc/impl_qpid.py rename to trove/openstack/common/rpc/impl_qpid.py index af902d3f35..e5a41e93a0 100644 --- a/reddwarf/openstack/common/rpc/impl_qpid.py +++ b/trove/openstack/common/rpc/impl_qpid.py @@ -24,12 +24,12 @@ import eventlet import greenlet from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.rpc import amqp as rpc_amqp -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import jsonutils +from trove.openstack.common import log as logging +from trove.openstack.common.rpc import amqp as rpc_amqp +from trove.openstack.common.rpc import common as rpc_common qpid_messaging = importutils.try_import("qpid.messaging") qpid_exceptions = importutils.try_import("qpid.messaging.exceptions") diff --git a/reddwarf/openstack/common/rpc/impl_zmq.py b/trove/openstack/common/rpc/impl_zmq.py similarity index 98% rename from reddwarf/openstack/common/rpc/impl_zmq.py rename to trove/openstack/common/rpc/impl_zmq.py index 90a28fa224..3feccb29b0 100644 --- a/reddwarf/openstack/common/rpc/impl_zmq.py +++ b/trove/openstack/common/rpc/impl_zmq.py @@ -26,12 +26,12 @@ import eventlet import greenlet from oslo.config import cfg -from reddwarf.openstack.common import excutils -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import processutils as utils -from reddwarf.openstack.common.rpc import common as rpc_common +from trove.openstack.common import excutils +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import jsonutils +from trove.openstack.common import processutils as utils +from trove.openstack.common.rpc import common as rpc_common zmq = importutils.try_import('eventlet.green.zmq') @@ -52,7 +52,7 @@ zmq_opts = [ # The module.Class to use for matchmaking. cfg.StrOpt( 'rpc_zmq_matchmaker', - default=('reddwarf.openstack.common.rpc.' + default=('trove.openstack.common.rpc.' 'matchmaker.MatchMakerLocalhost'), help='MatchMaker driver', ), diff --git a/reddwarf/openstack/common/rpc/matchmaker.py b/trove/openstack/common/rpc/matchmaker.py similarity index 99% rename from reddwarf/openstack/common/rpc/matchmaker.py rename to trove/openstack/common/rpc/matchmaker.py index 65f92d95c4..0fa40393be 100644 --- a/reddwarf/openstack/common/rpc/matchmaker.py +++ b/trove/openstack/common/rpc/matchmaker.py @@ -25,8 +25,8 @@ import json import eventlet from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging matchmaker_opts = [ diff --git a/reddwarf/openstack/common/rpc/matchmaker_redis.py b/trove/openstack/common/rpc/matchmaker_redis.py similarity index 96% rename from reddwarf/openstack/common/rpc/matchmaker_redis.py rename to trove/openstack/common/rpc/matchmaker_redis.py index 8d3af92572..72c6222ffb 100644 --- a/reddwarf/openstack/common/rpc/matchmaker_redis.py +++ b/trove/openstack/common/rpc/matchmaker_redis.py @@ -20,9 +20,9 @@ return keys for direct exchanges, per (approximate) AMQP parlance. from oslo.config import cfg -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.rpc import matchmaker as mm_common +from trove.openstack.common import importutils +from trove.openstack.common import log as logging +from trove.openstack.common.rpc import matchmaker as mm_common redis = importutils.try_import('redis') diff --git a/reddwarf/openstack/common/rpc/proxy.py b/trove/openstack/common/rpc/proxy.py similarity index 99% rename from reddwarf/openstack/common/rpc/proxy.py rename to trove/openstack/common/rpc/proxy.py index f47eac4f57..349d494e27 100644 --- a/reddwarf/openstack/common/rpc/proxy.py +++ b/trove/openstack/common/rpc/proxy.py @@ -22,7 +22,7 @@ For more information about rpc API version numbers, see: """ -from reddwarf.openstack.common import rpc +from trove.openstack.common import rpc class RpcProxy(object): diff --git a/reddwarf/openstack/common/rpc/service.py b/trove/openstack/common/rpc/service.py similarity index 90% rename from reddwarf/openstack/common/rpc/service.py rename to trove/openstack/common/rpc/service.py index 3301c2785d..83467c11f0 100644 --- a/reddwarf/openstack/common/rpc/service.py +++ b/trove/openstack/common/rpc/service.py @@ -17,11 +17,11 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import rpc -from reddwarf.openstack.common.rpc import dispatcher as rpc_dispatcher -from reddwarf.openstack.common import service +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common import rpc +from trove.openstack.common.rpc import dispatcher as rpc_dispatcher +from trove.openstack.common import service LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/rpc/zmq_receiver.py b/trove/openstack/common/rpc/zmq_receiver.py similarity index 88% rename from reddwarf/openstack/common/rpc/zmq_receiver.py rename to trove/openstack/common/rpc/zmq_receiver.py index 6eb8944270..3037fed4c6 100755 --- a/reddwarf/openstack/common/rpc/zmq_receiver.py +++ b/trove/openstack/common/rpc/zmq_receiver.py @@ -23,9 +23,9 @@ import sys from oslo.config import cfg -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import rpc -from reddwarf.openstack.common.rpc import impl_zmq +from trove.openstack.common import log as logging +from trove.openstack.common import rpc +from trove.openstack.common.rpc import impl_zmq CONF = cfg.CONF CONF.register_opts(rpc.rpc_opts) diff --git a/reddwarf/openstack/common/service.py b/trove/openstack/common/service.py similarity index 96% rename from reddwarf/openstack/common/service.py rename to trove/openstack/common/service.py index 45a36aa546..68df7175eb 100644 --- a/reddwarf/openstack/common/service.py +++ b/trove/openstack/common/service.py @@ -30,14 +30,14 @@ import eventlet import logging as std_logging from oslo.config import cfg -from reddwarf.openstack.common import eventlet_backdoor -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import threadgroup +from trove.openstack.common import eventlet_backdoor +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import importutils +from trove.openstack.common import log as logging +from trove.openstack.common import threadgroup -rpc = importutils.try_import('reddwarf.openstack.common.rpc') +rpc = importutils.try_import('trove.openstack.common.rpc') CONF = cfg.CONF LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/sslutils.py b/trove/openstack/common/sslutils.py similarity index 97% rename from reddwarf/openstack/common/sslutils.py rename to trove/openstack/common/sslutils.py index dbabf0d094..a07f6f94bd 100644 --- a/reddwarf/openstack/common/sslutils.py +++ b/trove/openstack/common/sslutils.py @@ -19,7 +19,7 @@ import ssl from oslo.config import cfg -from reddwarf.openstack.common.gettextutils import _ +from trove.openstack.common.gettextutils import _ ssl_opts = [ diff --git a/reddwarf/openstack/common/testutils.py b/trove/openstack/common/testutils.py similarity index 100% rename from reddwarf/openstack/common/testutils.py rename to trove/openstack/common/testutils.py diff --git a/reddwarf/openstack/common/threadgroup.py b/trove/openstack/common/threadgroup.py similarity index 97% rename from reddwarf/openstack/common/threadgroup.py rename to trove/openstack/common/threadgroup.py index 5cb0934822..a614a428f6 100644 --- a/reddwarf/openstack/common/threadgroup.py +++ b/trove/openstack/common/threadgroup.py @@ -18,8 +18,8 @@ from eventlet import greenlet from eventlet import greenpool from eventlet import greenthread -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import loopingcall +from trove.openstack.common import log as logging +from trove.openstack.common import loopingcall LOG = logging.getLogger(__name__) diff --git a/reddwarf/openstack/common/timeutils.py b/trove/openstack/common/timeutils.py similarity index 100% rename from reddwarf/openstack/common/timeutils.py rename to trove/openstack/common/timeutils.py diff --git a/reddwarf/openstack/common/utils.py b/trove/openstack/common/utils.py similarity index 100% rename from reddwarf/openstack/common/utils.py rename to trove/openstack/common/utils.py diff --git a/reddwarf/openstack/common/uuidutils.py b/trove/openstack/common/uuidutils.py similarity index 100% rename from reddwarf/openstack/common/uuidutils.py rename to trove/openstack/common/uuidutils.py diff --git a/reddwarf/openstack/common/wsgi.py b/trove/openstack/common/wsgi.py similarity index 98% rename from reddwarf/openstack/common/wsgi.py rename to trove/openstack/common/wsgi.py index 7f9b716689..d42d83c233 100644 --- a/reddwarf/openstack/common/wsgi.py +++ b/trove/openstack/common/wsgi.py @@ -38,13 +38,13 @@ import webob.exc from xml.dom import minidom from xml.parsers import expat -from reddwarf.openstack.common import exception -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common import jsonutils -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import service -from reddwarf.openstack.common import sslutils -from reddwarf.openstack.common import xmlutils +from trove.openstack.common import exception +from trove.openstack.common.gettextutils import _ +from trove.openstack.common import jsonutils +from trove.openstack.common import log as logging +from trove.openstack.common import service +from trove.openstack.common import sslutils +from trove.openstack.common import xmlutils socket_opts = [ cfg.IntOpt('backlog', diff --git a/reddwarf/openstack/common/xmlutils.py b/trove/openstack/common/xmlutils.py similarity index 100% rename from reddwarf/openstack/common/xmlutils.py rename to trove/openstack/common/xmlutils.py diff --git a/reddwarf/quota/__init__.py b/trove/quota/__init__.py similarity index 100% rename from reddwarf/quota/__init__.py rename to trove/quota/__init__.py diff --git a/reddwarf/quota/models.py b/trove/quota/models.py similarity index 94% rename from reddwarf/quota/models.py rename to trove/quota/models.py index 204e252a95..571c31f17f 100644 --- a/reddwarf/quota/models.py +++ b/trove/quota/models.py @@ -13,10 +13,10 @@ # under the License. -from reddwarf.common import cfg -from reddwarf.common import utils -from reddwarf.db import models as dbmodels -from reddwarf.openstack.common import log as logging +from trove.common import cfg +from trove.common import utils +from trove.db import models as dbmodels +from trove.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/reddwarf/quota/quota.py b/trove/quota/quota.py similarity index 96% rename from reddwarf/quota/quota.py rename to trove/quota/quota.py index cbf6bab81c..c6299a9790 100644 --- a/reddwarf/quota/quota.py +++ b/trove/quota/quota.py @@ -17,15 +17,15 @@ """Quotas for DB instances and resources.""" -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ from oslo.config import cfg -from reddwarf.common import exception -from reddwarf.openstack.common import importutils -from reddwarf.quota.models import Quota -from reddwarf.quota.models import QuotaUsage -from reddwarf.quota.models import Reservation -from reddwarf.quota.models import Resource +from trove.common import exception +from trove.openstack.common import importutils +from trove.quota.models import Quota +from trove.quota.models import QuotaUsage +from trove.quota.models import Reservation +from trove.quota.models import Resource LOG = logging.getLogger(__name__) CONF = cfg.CONF @@ -312,7 +312,7 @@ QUOTAS = QuotaEngine() ''' Define all kind of resources here ''' resources = [Resource(Resource.INSTANCES, 'max_instances_per_user'), Resource(Resource.BACKUPS, 'max_backups_per_user')] -if CONF.reddwarf_volume_support: +if CONF.trove_volume_support: resources.append(Resource(Resource.VOLUMES, 'max_volumes_per_user')) QUOTAS.register_resources(resources) diff --git a/reddwarf/taskmanager/__init__.py b/trove/taskmanager/__init__.py similarity index 100% rename from reddwarf/taskmanager/__init__.py rename to trove/taskmanager/__init__.py diff --git a/reddwarf/taskmanager/api.py b/trove/taskmanager/api.py similarity index 94% rename from reddwarf/taskmanager/api.py rename to trove/taskmanager/api.py index 8133302853..a347fed187 100644 --- a/reddwarf/taskmanager/api.py +++ b/trove/taskmanager/api.py @@ -22,9 +22,9 @@ Routes all the requests to the task manager. import traceback import sys -from reddwarf.common import cfg -from reddwarf.common.manager import ManagerAPI -from reddwarf.openstack.common import log as logging +from trove.common import cfg +from trove.common.manager import ManagerAPI +from trove.openstack.common import log as logging CONF = cfg.CONF @@ -39,8 +39,8 @@ class API(ManagerAPI): """API for interacting with the task manager.""" def _fake_cast(self, method_name, **kwargs): - from reddwarf.tests.fakes.common import get_event_spawer - from reddwarf.taskmanager.manager import Manager + from trove.tests.fakes.common import get_event_spawer + from trove.taskmanager.manager import Manager method = getattr(Manager(), method_name) def func(): diff --git a/reddwarf/taskmanager/manager.py b/trove/taskmanager/manager.py similarity index 89% rename from reddwarf/taskmanager/manager.py rename to trove/taskmanager/manager.py index 1b28f71e96..34a19d6aad 100644 --- a/reddwarf/taskmanager/manager.py +++ b/trove/taskmanager/manager.py @@ -14,16 +14,16 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -from reddwarf.common.context import ReddwarfContext +from trove.common.context import TroveContext -import reddwarf.extensions.mgmt.instances.models as mgmtmodels -import reddwarf.common.cfg as cfg -from reddwarf.common import exception -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common import importutils -from reddwarf.openstack.common import periodic_task -from reddwarf.taskmanager import models -from reddwarf.taskmanager.models import FreshInstanceTasks +import trove.extensions.mgmt.instances.models as mgmtmodels +import trove.common.cfg as cfg +from trove.common import exception +from trove.openstack.common import log as logging +from trove.openstack.common import importutils +from trove.openstack.common import periodic_task +from trove.taskmanager import models +from trove.taskmanager.models import FreshInstanceTasks LOG = logging.getLogger(__name__) RPC_API_VERSION = "1.0" @@ -34,7 +34,7 @@ class Manager(periodic_task.PeriodicTasks): def __init__(self): super(Manager, self).__init__() - self.admin_context = ReddwarfContext( + self.admin_context = TroveContext( user=CONF.nova_proxy_admin_user, auth_token=CONF.nova_proxy_admin_pass, tenant=CONF.nova_proxy_admin_tenant_name) diff --git a/reddwarf/taskmanager/models.py b/trove/taskmanager/models.py similarity index 92% rename from reddwarf/taskmanager/models.py rename to trove/taskmanager/models.py index f0b3136916..949c3c3509 100644 --- a/reddwarf/taskmanager/models.py +++ b/trove/taskmanager/models.py @@ -16,30 +16,30 @@ import traceback from eventlet import greenthread from novaclient import exceptions as nova_exceptions -from reddwarf.common import cfg -from reddwarf.common import utils -from reddwarf.common.exception import GuestError -from reddwarf.common.exception import PollTimeOut -from reddwarf.common.exception import VolumeCreationFailure -from reddwarf.common.exception import ReddwarfError -from reddwarf.common.remote import create_dns_client -from reddwarf.common.remote import create_nova_client -from reddwarf.common.remote import create_nova_volume_client +from trove.common import cfg +from trove.common import utils +from trove.common.exception import GuestError +from trove.common.exception import PollTimeOut +from trove.common.exception import VolumeCreationFailure +from trove.common.exception import TroveError +from trove.common.remote import create_dns_client +from trove.common.remote import create_nova_client +from trove.common.remote import create_nova_volume_client from swiftclient.client import ClientException -from reddwarf.common.utils import poll_until -from reddwarf.instance import models as inst_models -from reddwarf.instance.models import BuiltInstance -from reddwarf.instance.models import FreshInstance -from reddwarf.instance.models import InstanceStatus -from reddwarf.instance.models import InstanceServiceStatus -from reddwarf.instance.models import ServiceStatuses -from reddwarf.instance.views import get_ip_address -from reddwarf.openstack.common import log as logging -from reddwarf.openstack.common.gettextutils import _ -from reddwarf.openstack.common.notifier import api as notifier -from reddwarf.openstack.common import timeutils -import reddwarf.common.remote as remote -import reddwarf.backup.models +from trove.common.utils import poll_until +from trove.instance import models as inst_models +from trove.instance.models import BuiltInstance +from trove.instance.models import FreshInstance +from trove.instance.models import InstanceStatus +from trove.instance.models import InstanceServiceStatus +from trove.instance.models import ServiceStatuses +from trove.instance.views import get_ip_address +from trove.openstack.common import log as logging +from trove.openstack.common.gettextutils import _ +from trove.openstack.common.notifier import api as notifier +from trove.openstack.common import timeutils +import trove.common.remote as remote +import trove.backup.models LOG = logging.getLogger(__name__) CONF = cfg.CONF @@ -60,7 +60,7 @@ class NotifyMixin(object): """ def send_usage_event(self, event_type, **kwargs): - event_type = 'reddwarf.instance.%s' % event_type + event_type = 'trove.instance.%s' % event_type publisher_id = CONF.host # Grab the instance size from the kwargs or from the nova client @@ -91,7 +91,7 @@ class NotifyMixin(object): 'user_id': self.context.user, } - if CONF.reddwarf_volume_support: + if CONF.trove_volume_support: payload.update({ 'volume_size': self.volume_size, 'nova_volume_id': self.volume_id @@ -160,7 +160,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): over billing a customer for a instance that they can never use. Returns: boolean if the service is active. - Raises: ReddwarfError if the service is in a failure state. + Raises: TroveError if the service is in a failure state. """ service = InstanceServiceStatus.find_by(instance_id=self.id) status = service.get_status() @@ -168,13 +168,13 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): return True elif status not in [ServiceStatuses.NEW, ServiceStatuses.BUILDING]: - raise ReddwarfError("Service not active, status: %s" % status) + raise TroveError("Service not active, status: %s" % status) c_id = self.db_info.compute_instance_id nova_status = self.nova_client.servers.get(c_id).status if nova_status in [InstanceStatus.ERROR, InstanceStatus.FAILED]: - raise ReddwarfError("Server not active, status: %s" % nova_status) + raise TroveError("Server not active, status: %s" % nova_status) return False def _create_server_volume(self, flavor_id, image_id, security_groups, @@ -236,8 +236,8 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): def _build_volume_info(self, volume_size=None): volume_info = None - volume_support = CONF.reddwarf_volume_support - LOG.debug(_("reddwarf volume support = %s") % volume_support) + volume_support = CONF.trove_volume_support + LOG.debug(_("trove volume support = %s") % volume_support) if volume_support: try: volume_info = self._create_volume(volume_size) @@ -261,7 +261,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): LOG.error(exc) LOG.error(traceback.format_exc()) self.update_db(task_status=task_status) - raise ReddwarfError(message=message) + raise TroveError(message=message) def _create_volume(self, volume_size): LOG.info("Entering create_volume") @@ -336,8 +336,8 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): def _create_dns_entry(self): LOG.debug("%s: Creating dns entry for instance: %s" % (greenthread.getcurrent(), self.id)) - dns_support = CONF.reddwarf_dns_support - LOG.debug(_("reddwarf dns support = %s") % dns_support) + dns_support = CONF.trove_dns_support + LOG.debug(_("trove dns support = %s") % dns_support) if dns_support: nova_client = create_nova_client(self.context) @@ -359,7 +359,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin): msg = _("Instance IP not available, instance (%s): " "server had status (%s).") LOG.error(msg % (self.id, server.status)) - raise ReddwarfError(status=server.status) + raise TroveError(status=server.status) poll_until(get_server, ip_is_available, sleep_time=1, time_out=DNS_TIME_OUT) server = nova_client.servers.get(self.db_info.compute_instance_id) @@ -394,8 +394,8 @@ class BuiltInstanceTasks(BuiltInstance, NotifyMixin): % self.server.id) LOG.error(ex) try: - dns_support = CONF.reddwarf_dns_support - LOG.debug(_("reddwarf dns support = %s") % dns_support) + dns_support = CONF.trove_dns_support + LOG.debug(_("trove dns support = %s") % dns_support) if dns_support: dns_api = create_dns_client(self.context) dns_api.delete_instance_entry(instance_id=self.db_info.id) @@ -544,7 +544,7 @@ class BackupTasks(object): @classmethod def delete_backup(cls, context, backup_id): #delete backup from swift - backup = reddwarf.backup.models.Backup.get_by_id(backup_id) + backup = trove.backup.models.Backup.get_by_id(backup_id) try: filename = backup.filename if filename: @@ -553,7 +553,7 @@ class BackupTasks(object): except (ClientException, ValueError) as e: LOG.exception("Exception deleting from swift. Details: %s" % e) LOG.error("Failed to delete swift objects") - backup.state = reddwarf.backup.models.BackupState.FAILED + backup.state = trove.backup.models.BackupState.FAILED else: backup.delete() @@ -580,7 +580,7 @@ class ResizeActionBase(object): if self.instance.server.status != "VERIFY_RESIZE": msg = "Migration failed! status=%s and not %s" \ % (self.instance.server.status, 'VERIFY_RESIZE') - raise ReddwarfError(msg) + raise TroveError(msg) def _assert_mysql_is_ok(self): # Tell the guest to turn on MySQL, and ensure the status becomes @@ -698,7 +698,7 @@ class ResizeAction(ResizeActionBase): if str(self.instance.server.flavor['id']) != str(self.new_flavor_id): msg = "Assertion failed! flavor_id=%s and not %s" \ % (self.instance.server.flavor['id'], self.new_flavor_id) - raise ReddwarfError(msg) + raise TroveError(msg) def _initiate_nova_action(self): self.instance.server.resize(self.new_flavor_id) diff --git a/reddwarf/taskmanager/service.py b/trove/taskmanager/service.py similarity index 94% rename from reddwarf/taskmanager/service.py rename to trove/taskmanager/service.py index a2a44c0f25..f0ccb27ae4 100644 --- a/reddwarf/taskmanager/service.py +++ b/trove/taskmanager/service.py @@ -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 LOG = logging.getLogger(__name__) diff --git a/reddwarf/tests/__init__.py b/trove/tests/__init__.py similarity index 100% rename from reddwarf/tests/__init__.py rename to trove/tests/__init__.py diff --git a/reddwarf/tests/api/__init__.py b/trove/tests/api/__init__.py similarity index 100% rename from reddwarf/tests/api/__init__.py rename to trove/tests/api/__init__.py diff --git a/reddwarf/tests/api/backups.py b/trove/tests/api/backups.py similarity index 96% rename from reddwarf/tests/api/backups.py rename to trove/tests/api/backups.py index c09da8969d..a11c96ce15 100644 --- a/reddwarf/tests/api/backups.py +++ b/trove/tests/api/backups.py @@ -19,12 +19,12 @@ from proboscis.asserts import fail from proboscis import test from proboscis import SkipTest from proboscis.decorators import time_out -from reddwarf.tests.util import poll_until -from reddwarf.tests.util import test_config -from reddwarfclient import exceptions -from reddwarf.tests.api.instances import WaitForGuestInstallationToFinish -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.api.instances import assert_unprocessable +from trove.tests.util import poll_until +from trove.tests.util import test_config +from troveclient import exceptions +from trove.tests.api.instances import WaitForGuestInstallationToFinish +from trove.tests.api.instances import instance_info +from trove.tests.api.instances import assert_unprocessable import time GROUP = "dbaas.api.backups" diff --git a/reddwarf/tests/api/databases.py b/trove/tests/api/databases.py similarity index 97% rename from reddwarf/tests/api/databases.py rename to trove/tests/api/databases.py index 7ca4713ae9..d5514916d8 100644 --- a/reddwarf/tests/api/databases.py +++ b/trove/tests/api/databases.py @@ -14,7 +14,7 @@ import time -from reddwarfclient import exceptions +from troveclient import exceptions from proboscis import before_class from proboscis import test @@ -27,12 +27,12 @@ from proboscis.asserts import fail from proboscis.decorators import expect_exception from proboscis.decorators import time_out -from reddwarf import tests +from trove import tests -from reddwarf.tests import util -from reddwarf.tests.api.instances import GROUP_START -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.util import test_config +from trove.tests import util +from trove.tests.api.instances import GROUP_START +from trove.tests.api.instances import instance_info +from trove.tests.util import test_config GROUP = "dbaas.api.databases" FAKE = test_config.values['fake_mode'] diff --git a/reddwarf/tests/api/flavors.py b/trove/tests/api/flavors.py similarity index 92% rename from reddwarf/tests/api/flavors.py rename to trove/tests/api/flavors.py index f904969ca2..a096953a8a 100644 --- a/reddwarf/tests/api/flavors.py +++ b/trove/tests/api/flavors.py @@ -18,21 +18,21 @@ import os from nose.tools import assert_equal from nose.tools import assert_false from nose.tools import assert_true -from reddwarfclient import exceptions -from reddwarfclient.flavors import Flavor -from reddwarfclient.flavors import Flavors +from troveclient import exceptions +from troveclient.flavors import Flavor +from troveclient.flavors import Flavors from proboscis import before_class from proboscis import test from proboscis.asserts import assert_raises from proboscis import SkipTest -from reddwarf import tests -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import create_nova_client -from reddwarf.tests.util import test_config -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.util.check import AttrCheck +from trove import tests +from trove.tests.util import create_dbaas_client +from trove.tests.util import create_nova_client +from trove.tests.util import test_config +from trove.tests.util.users import Requirements +from trove.tests.util.check import AttrCheck GROUP = "dbaas.api.flavors" @@ -94,7 +94,7 @@ class Flavors(object): @before_class def setUp(self): rd_user = test_config.users.find_user( - Requirements(is_admin=False, services=["reddwarf"])) + Requirements(is_admin=False, services=["trove"])) self.rd_client = create_dbaas_client(rd_user) if test_config.nova_client is not None: @@ -104,7 +104,7 @@ class Flavors(object): def get_expected_flavors(self): # If we have access to the client, great! Let's use that as the flavors - # returned by Reddwarf should be identical. + # returned by Trove should be identical. if test_config.nova_client is not None: return self.nova_client.flavors.list() # If we don't have access to the client the flavors need to be spelled diff --git a/reddwarf/tests/api/header.py b/trove/tests/api/header.py similarity index 81% rename from reddwarf/tests/api/header.py rename to trove/tests/api/header.py index 9fef1b1297..a4885ae984 100644 --- a/reddwarf/tests/api/header.py +++ b/trove/tests/api/header.py @@ -3,19 +3,19 @@ from proboscis.asserts import * from proboscis import SkipTest from functools import wraps -from reddwarfclient.client import ReddwarfHTTPClient -from reddwarf.tests.api.versions import Versions -from reddwarfclient import exceptions +from troveclient.client import TroveHTTPClient +from trove.tests.api.versions import Versions +from troveclient import exceptions @test(groups=['dbaas.api.headers']) def must_work_with_blank_accept_headers(): - """Test to make sure that reddwarf works without the headers""" + """Test to make sure that trove works without the headers""" versions = Versions() versions.setUp() client = versions.client - if type(client.client).morph_request != ReddwarfHTTPClient.morph_request: + if type(client.client).morph_request != TroveHTTPClient.morph_request: raise SkipTest("Not using the JSON client so can't execute this test.") original_morph_request = client.client.morph_request diff --git a/reddwarf/tests/api/instances.py b/trove/tests/api/instances.py similarity index 97% rename from reddwarf/tests/api/instances.py rename to trove/tests/api/instances.py index 3c3cdc5860..3f195a2d36 100644 --- a/reddwarf/tests/api/instances.py +++ b/trove/tests/api/instances.py @@ -19,7 +19,7 @@ import re import string import time import unittest -from reddwarf.tests import util +from trove.tests import util import urlparse @@ -36,8 +36,8 @@ GROUP_SECURITY_GROUPS = "dbaas.api.security_groups" from datetime import datetime from time import sleep -from reddwarf.common import exception as rd_exceptions -from reddwarfclient import exceptions +from trove.common import exception as rd_exceptions +from troveclient import exceptions from proboscis.decorators import time_out from proboscis import before_class @@ -52,20 +52,20 @@ from proboscis.asserts import assert_is_not_none from proboscis.asserts import assert_true from proboscis.asserts import fail -from reddwarf.openstack.common import timeutils -from reddwarf import tests -from reddwarf.tests.config import CONFIG -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import create_nova_client -from reddwarf.tests.util.usage import create_usage_verifier -from reddwarf.tests.util import iso_time -from reddwarf.tests.util import process -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.util import skip_if_xml -from reddwarf.tests.util import string_in_list -from reddwarf.tests.util import poll_until -from reddwarf.tests.util.check import AttrCheck -from reddwarf.tests.util.check import TypeCheck +from trove.openstack.common import timeutils +from trove import tests +from trove.tests.config import CONFIG +from trove.tests.util import create_dbaas_client +from trove.tests.util import create_nova_client +from trove.tests.util.usage import create_usage_verifier +from trove.tests.util import iso_time +from trove.tests.util import process +from trove.tests.util.users import Requirements +from trove.tests.util import skip_if_xml +from trove.tests.util import string_in_list +from trove.tests.util import poll_until +from trove.tests.util.check import AttrCheck +from trove.tests.util.check import TypeCheck class InstanceTestInfo(object): @@ -114,7 +114,7 @@ class InstanceTestInfo(object): instance_info = InstanceTestInfo() dbaas = None # Rich client used throughout this test. dbaas_admin = None # Same as above, with admin privs. -VOLUME_SUPPORT = CONFIG.get('reddwarf_volume_support', False) +VOLUME_SUPPORT = CONFIG.get('trove_volume_support', False) EPHEMERAL_SUPPORT = not VOLUME_SUPPORT and CONFIG.get('device_path', '/dev/vdb') is not None @@ -210,9 +210,9 @@ class InstanceSetup(object): #TODO(tim.simpson): I'm not sure why this is here. The default image # setup should be in initialization test code that lives somewhere # else, probably with the code that uploads the image. - key = "reddwarf_imageref" + key = "trove_imageref" value = 1 - description = "Default Image for Reddwarf" + description = "Default Image for Trove" config = {'key': key, 'value': value, 'description': description} try: dbaas_admin.configs.create([config]) @@ -252,16 +252,16 @@ class CreateInstanceQuotaTest(unittest.TestCase): self.test_info = copy.deepcopy(instance_info) def tearDown(self): - quota_dict = {'instances': CONFIG.reddwarf_max_instances_per_user} + quota_dict = {'instances': CONFIG.trove_max_instances_per_user} if VOLUME_SUPPORT: - quota_dict['volumes'] = CONFIG.reddwarf_max_volumes_per_user + quota_dict['volumes'] = CONFIG.trove_max_volumes_per_user dbaas_admin.quota.update(self.test_info.user.tenant_id, quota_dict) def test_instance_size_too_big(self): - if ('reddwarf_max_accepted_volume_size' in CONFIG.values and + if ('trove_max_accepted_volume_size' in CONFIG.values and VOLUME_SUPPORT): - too_big = CONFIG.reddwarf_max_accepted_volume_size + too_big = CONFIG.trove_max_accepted_volume_size self.test_info.volume = {'size': too_big + 1} self.test_info.name = "way_too_large" @@ -296,7 +296,7 @@ class CreateInstanceQuotaTest(unittest.TestCase): self.test_info.volume = None if VOLUME_SUPPORT: - assert_equal(CONFIG.reddwarf_max_volumes_per_user, + assert_equal(CONFIG.trove_max_volumes_per_user, verify_quota['volumes']) self.test_info.volume = {'size': 1} @@ -389,7 +389,7 @@ class CreateInstance(object): 'name', 'status', 'updated'] if VOLUME_SUPPORT: expected_attrs.append('volume') - if CONFIG.reddwarf_dns_support: + if CONFIG.trove_dns_support: expected_attrs.append('hostname') with CheckInstance(result._info) as check: @@ -858,7 +858,7 @@ class TestInstanceListing(object): check.links(instance_dict['links']) check.used_volume() - @test(enabled=CONFIG.reddwarf_dns_support) + @test(enabled=CONFIG.trove_dns_support) def test_instance_hostname(self): instance = dbaas.instances.get(instance_info.id) assert_equal(200, dbaas.last_http_code) @@ -950,7 +950,7 @@ class TestCreateNotification(object): 'availability_zone': 'nova', } instance_info.consumer.check_message(instance_info.id, - 'reddwarf.instance.create', + 'trove.instance.create', **expected) @@ -1045,7 +1045,7 @@ class AfterDeleteChecks(object): 'deleted_at': iso_time(instance_info.deleted_at), } instance_info.consumer.check_message(instance_info.id, - 'reddwarf.instance.delete', + 'trove.instance.delete', **expected) @@ -1232,7 +1232,7 @@ class BadInstanceStatusBug(): replicate this error. A double migration is just one of them but since this is a known way to recreate that error we will use it here to be sure that the error is fixed. The actual code lives - in reddwarf/instance/models.py in _validate_can_perform_action() + in trove/instance/models.py in _validate_can_perform_action() """ # TODO(imsplitbit): test other instances where this issue could be # replicated. Resizing a resized instance awaiting confirmation diff --git a/reddwarf/tests/api/instances_actions.py b/trove/tests/api/instances_actions.py similarity index 95% rename from reddwarf/tests/api/instances_actions.py rename to trove/tests/api/instances_actions.py index d9aa20654f..6e19ec2eb1 100644 --- a/reddwarf/tests/api/instances_actions.py +++ b/trove/tests/api/instances_actions.py @@ -22,26 +22,26 @@ from proboscis.asserts import * from proboscis.decorators import time_out from proboscis import SkipTest -from reddwarf import tests -from reddwarf.tests.util.check import Checker -from reddwarfclient.exceptions import BadRequest -from reddwarfclient.exceptions import HTTPNotImplemented -from reddwarfclient.exceptions import UnprocessableEntity -from reddwarf.tests.api.instances import GROUP as INSTANCE_GROUP -from reddwarf.tests.api.instances import GROUP_START -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.api.instances import assert_unprocessable -from reddwarf.tests.api.instances import VOLUME_SUPPORT -from reddwarf.tests.api.instances import EPHEMERAL_SUPPORT -from reddwarf.tests import util -from reddwarf.tests.util.server_connection import create_server_connection -from reddwarf.tests.util import poll_until -from reddwarf.tests.config import CONFIG -from reddwarf.tests.util import LocalSqlClient -from reddwarf.tests.util import iso_time +from trove import tests +from trove.tests.util.check import Checker +from troveclient.exceptions import BadRequest +from troveclient.exceptions import HTTPNotImplemented +from troveclient.exceptions import UnprocessableEntity +from trove.tests.api.instances import GROUP as INSTANCE_GROUP +from trove.tests.api.instances import GROUP_START +from trove.tests.api.instances import instance_info +from trove.tests.api.instances import assert_unprocessable +from trove.tests.api.instances import VOLUME_SUPPORT +from trove.tests.api.instances import EPHEMERAL_SUPPORT +from trove.tests import util +from trove.tests.util.server_connection import create_server_connection +from trove.tests.util import poll_until +from trove.tests.config import CONFIG +from trove.tests.util import LocalSqlClient +from trove.tests.util import iso_time from sqlalchemy import create_engine from sqlalchemy import exc as sqlalchemy_exc -from reddwarf.tests.util.check import TypeCheck +from trove.tests.util.check import TypeCheck from sqlalchemy.sql.expression import text GROUP = "dbaas.api.instances.actions" @@ -494,7 +494,7 @@ class ResizeInstanceTest(ActionTestBase): } instance_info.consumer.check_message(instance_info.id, - 'reddwarf.instance.modify_flavor', + 'trove.instance.modify_flavor', **expected) @test(depends_on=[test_instance_returns_to_active_after_resize], @@ -555,7 +555,7 @@ class ResizeInstanceTest(ActionTestBase): 'modify_at': iso_time(self.instance.updated), } instance_info.consumer.check_message(instance_info.id, - 'reddwarf.instance.modify_flavor', + 'trove.instance.modify_flavor', **expected) @@ -624,7 +624,7 @@ class ResizeInstanceVolume(object): 'volume_size': self.new_volume_size, } instance_info.consumer.check_message(instance_info.id, - 'reddwarf.instance.modify_volume', + 'trove.instance.modify_volume', **expected) @test diff --git a/reddwarf/tests/api/instances_delete.py b/trove/tests/api/instances_delete.py similarity index 92% rename from reddwarf/tests/api/instances_delete.py rename to trove/tests/api/instances_delete.py index acc8ad628c..0eb631c987 100644 --- a/reddwarf/tests/api/instances_delete.py +++ b/trove/tests/api/instances_delete.py @@ -5,13 +5,13 @@ from proboscis import test from proboscis.asserts import * from proboscis.decorators import time_out -from reddwarfclient import exceptions -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import poll_until -from reddwarf.tests.util import test_config -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.api.instances import VOLUME_SUPPORT +from troveclient import exceptions +from trove.tests.util import create_dbaas_client +from trove.tests.util import poll_until +from trove.tests.util import test_config +from trove.tests.util.users import Requirements +from trove.tests.api.instances import instance_info +from trove.tests.api.instances import VOLUME_SUPPORT class TestBase(object): diff --git a/reddwarf/tests/api/instances_mysql_down.py b/trove/tests/api/instances_mysql_down.py similarity index 93% rename from reddwarf/tests/api/instances_mysql_down.py rename to trove/tests/api/instances_mysql_down.py index 186cbd3161..8e06a8db1e 100644 --- a/reddwarf/tests/api/instances_mysql_down.py +++ b/trove/tests/api/instances_mysql_down.py @@ -25,13 +25,13 @@ from proboscis.asserts import * import time from datetime import datetime -from reddwarfclient import exceptions -from reddwarf.tests import util -from reddwarf.tests.util import create_client -from reddwarf.tests.util import poll_until -from reddwarf.tests.util import test_config -from reddwarf.tests.api.instances import VOLUME_SUPPORT -from reddwarf.tests.api.instances import EPHEMERAL_SUPPORT +from troveclient import exceptions +from trove.tests import util +from trove.tests.util import create_client +from trove.tests.util import poll_until +from trove.tests.util import test_config +from trove.tests.api.instances import VOLUME_SUPPORT +from trove.tests.api.instances import EPHEMERAL_SUPPORT @test(groups=["dbaas.api.instances.down"]) diff --git a/reddwarf/tests/api/instances_resize.py b/trove/tests/api/instances_resize.py similarity index 94% rename from reddwarf/tests/api/instances_resize.py rename to trove/tests/api/instances_resize.py index 92c528ced4..cb290783a6 100644 --- a/reddwarf/tests/api/instances_resize.py +++ b/trove/tests/api/instances_resize.py @@ -20,15 +20,15 @@ from proboscis import test from novaclient.exceptions import BadRequest from novaclient.v1_1.servers import Server -from reddwarf.common.exception import PollTimeOut -from reddwarf.common import utils -from reddwarf.common.context import ReddwarfContext -from reddwarf.guestagent import api as guest -from reddwarf.instance.models import DBInstance -from reddwarf.instance.models import ServiceStatuses -from reddwarf.instance.tasks import InstanceTasks -from reddwarf.openstack.common.rpc.common import RPCException -from reddwarf.taskmanager import models as models +from trove.common.exception import PollTimeOut +from trove.common import utils +from trove.common.context import TroveContext +from trove.guestagent import api as guest +from trove.instance.models import DBInstance +from trove.instance.models import ServiceStatuses +from trove.instance.tasks import InstanceTasks +from trove.openstack.common.rpc.common import RPCException +from trove.taskmanager import models as models GROUP = 'dbaas.api.instances.resize' @@ -41,7 +41,7 @@ class ResizeTestBase(TestCase): def _init(self): self.mock = mox.Mox() self.instance_id = 500 - context = ReddwarfContext() + context = TroveContext() self.db_info = DBInstance.create( name="instance", flavor_id=OLD_FLAVOR_ID, diff --git a/reddwarf/tests/api/limits.py b/trove/tests/api/limits.py similarity index 90% rename from reddwarf/tests/api/limits.py rename to trove/tests/api/limits.py index dea1ba2378..6b44ee3a35 100644 --- a/reddwarf/tests/api/limits.py +++ b/trove/tests/api/limits.py @@ -5,12 +5,12 @@ from nose.tools import assert_true from proboscis import before_class from proboscis import test -from reddwarf.openstack.common import timeutils -from reddwarf.tests.util import create_dbaas_client -from reddwarfclient import exceptions +from trove.openstack.common import timeutils +from trove.tests.util import create_dbaas_client +from troveclient import exceptions from datetime import datetime -from reddwarf.tests.util.users import Users -from reddwarf.tests.config import CONFIG +from trove.tests.util.users import Users +from trove.tests.config import CONFIG GROUP = "dbaas.api.limits" DEFAULT_RATE = 200 @@ -32,7 +32,7 @@ class Limits(object): "tenant": "4000", "requirements": { "is_admin": False, - "services": ["reddwarf"] + "services": ["trove"] } }, { @@ -41,7 +41,7 @@ class Limits(object): "tenant": "4050", "requirements": { "is_admin": False, - "services": ["reddwarf"] + "services": ["trove"] } }] @@ -76,7 +76,7 @@ class Limits(object): assert_equal(abs_limits.verb, "ABSOLUTE") assert_equal(int(abs_limits.max_instances), DEFAULT_MAX_INSTANCES) assert_equal(int(abs_limits.max_backups), DEFAULT_MAX_BACKUPS) - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: assert_equal(int(abs_limits.max_volumes), DEFAULT_MAX_VOLUMES) for k in d: @@ -99,7 +99,7 @@ class Limits(object): assert_equal(int(abs_limits.max_instances), DEFAULT_MAX_INSTANCES) assert_equal(int(abs_limits.max_backups), DEFAULT_MAX_BACKUPS) - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: assert_equal(int(abs_limits.max_volumes), DEFAULT_MAX_VOLUMES) assert_equal(get.verb, "GET") assert_equal(get.unit, "MINUTE") @@ -129,7 +129,7 @@ class Limits(object): DEFAULT_MAX_INSTANCES) assert_equal(int(abs_limits.max_backups), DEFAULT_MAX_BACKUPS) - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: assert_equal(int(abs_limits.max_volumes), DEFAULT_MAX_VOLUMES) diff --git a/reddwarf/tests/api/mgmt/__init__.py b/trove/tests/api/mgmt/__init__.py similarity index 100% rename from reddwarf/tests/api/mgmt/__init__.py rename to trove/tests/api/mgmt/__init__.py diff --git a/reddwarf/tests/api/mgmt/accounts.py b/trove/tests/api/mgmt/accounts.py similarity index 94% rename from reddwarf/tests/api/mgmt/accounts.py rename to trove/tests/api/mgmt/accounts.py index b08bee4652..c42ccb3eac 100644 --- a/reddwarf/tests/api/mgmt/accounts.py +++ b/trove/tests/api/mgmt/accounts.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarfclient import exceptions +from troveclient import exceptions from nose.plugins.skip import SkipTest @@ -22,14 +22,14 @@ from proboscis import test from proboscis.asserts import * from proboscis.decorators import time_out -from reddwarf import tests -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.util import test_config -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import poll_until -from reddwarf.tests.config import CONFIG -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.api.instances import existing_instance +from trove import tests +from trove.tests.api.instances import instance_info +from trove.tests.util import test_config +from trove.tests.util import create_dbaas_client +from trove.tests.util import poll_until +from trove.tests.config import CONFIG +from trove.tests.util.users import Requirements +from trove.tests.api.instances import existing_instance GROUP = "dbaas.api.mgmt.accounts" @@ -190,7 +190,7 @@ class AccountWithBrokenInstance(object): self.name = 'test_SERVER_ERROR' # Create an instance with a broken compute instance. volume = None - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: volume = {'size': 1} self.response = self.client.instances.create( self.name, diff --git a/reddwarf/tests/api/mgmt/admin_required.py b/trove/tests/api/mgmt/admin_required.py similarity index 93% rename from reddwarf/tests/api/mgmt/admin_required.py rename to trove/tests/api/mgmt/admin_required.py index 3c2ce218ba..e667109cc2 100644 --- a/reddwarf/tests/api/mgmt/admin_required.py +++ b/trove/tests/api/mgmt/admin_required.py @@ -12,16 +12,16 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarfclient.exceptions import Unauthorized +from troveclient.exceptions import Unauthorized from proboscis import before_class from proboscis import test from proboscis.asserts import assert_raises -from reddwarf import tests -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import test_config -from reddwarf.tests.util.users import Requirements +from trove import tests +from trove.tests.util import create_dbaas_client +from trove.tests.util import test_config +from trove.tests.util.users import Requirements GROUP = "dbaas.api.mgmt.admin" diff --git a/reddwarf/tests/api/mgmt/instances.py b/trove/tests/api/mgmt/instances.py similarity index 90% rename from reddwarf/tests/api/mgmt/instances.py rename to trove/tests/api/mgmt/instances.py index 391cad7c87..fcc24eeafb 100644 --- a/reddwarf/tests/api/mgmt/instances.py +++ b/trove/tests/api/mgmt/instances.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarfclient import exceptions +from troveclient import exceptions from proboscis import before_class from proboscis import test @@ -21,24 +21,24 @@ from proboscis.asserts import assert_raises from proboscis.asserts import assert_true from proboscis.check import Check -from reddwarf import tests -from reddwarf.tests.config import CONFIG -from reddwarf.tests.util import create_client -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.util.check import CollectionCheck -from reddwarf.tests.util.check import TypeCheck +from trove import tests +from trove.tests.config import CONFIG +from trove.tests.util import create_client +from trove.tests.util import create_dbaas_client +from trove.tests.util.users import Requirements +from trove.tests.util.check import CollectionCheck +from trove.tests.util.check import TypeCheck -from reddwarf.tests.api.instances import CreateInstance -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.api.instances import GROUP_START -from reddwarf.tests.api.instances import GROUP_TEST -from reddwarf.tests.util import poll_until +from trove.tests.api.instances import CreateInstance +from trove.tests.api.instances import instance_info +from trove.tests.api.instances import GROUP_START +from trove.tests.api.instances import GROUP_TEST +from trove.tests.util import poll_until GROUP = "dbaas.api.mgmt.instances" XML_SUPPORT = False -if hasattr(CONFIG, 'reddwarf_client_cls'): - if CONFIG.reddwarf_client_cls == "reddwarfclient.xml.ReddwarfXmlClient": +if hasattr(CONFIG, 'trove_client_cls'): + if CONFIG.trove_client_cls == "troveclient.xml.TroveXmlClient": XML_SUPPORT = True @@ -102,7 +102,7 @@ def mgmt_instance_get(): instance.has_field('tenant_id', basestring) instance.has_field('updated', basestring) # Can be None if no volume is given on this instance. - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: instance.has_field('volume', dict, volume_check) else: instance.has_field('volume', None) @@ -117,8 +117,8 @@ def mgmt_instance_get(): server.has_element("name", basestring) server.has_element("status", basestring) server.has_element("tenant_id", basestring) - if (CONFIG.reddwarf_volume_support and - CONFIG.reddwarf_main_instance_has_volume): + if (CONFIG.trove_volume_support and + CONFIG.trove_main_instance_has_volume): with CollectionCheck("volume", api_instance.volume) as volume: volume.has_element("attachments", list) volume.has_element("availability_zone", basestring) @@ -143,7 +143,7 @@ class WhenMgmtInstanceGetIsCalledButServerIsNotReady(object): # TODO(tim.simpson): This would be a lot nicer looking if we used a # traditional mock framework. body = None - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: body = {'size': 13} response = self.client.instances.create( 'test_SERVER_ERROR', @@ -216,7 +216,7 @@ class MgmtInstancesIndex(object): 'tenant_id', 'updated', ] - if CONFIG.reddwarf_volume_support: + if CONFIG.trove_volume_support: expected_fields.append('volume') index = self.client.management.index() diff --git a/reddwarf/tests/api/mgmt/instances_actions.py b/trove/tests/api/mgmt/instances_actions.py similarity index 88% rename from reddwarf/tests/api/mgmt/instances_actions.py rename to trove/tests/api/mgmt/instances_actions.py index f3a869931a..3563808c64 100644 --- a/reddwarf/tests/api/mgmt/instances_actions.py +++ b/trove/tests/api/mgmt/instances_actions.py @@ -13,11 +13,11 @@ # under the License. import mox -from reddwarf.common.context import ReddwarfContext -from reddwarf.instance.tasks import InstanceTasks -from reddwarf.instance import models as imodels -from reddwarf.instance.models import DBInstance -from reddwarf.extensions.mgmt.instances.models import MgmtInstance +from trove.common.context import TroveContext +from trove.instance.tasks import InstanceTasks +from trove.instance import models as imodels +from trove.instance.models import DBInstance +from trove.extensions.mgmt.instances.models import MgmtInstance from novaclient.v1_1.servers import Server @@ -26,8 +26,8 @@ from proboscis import before_class from proboscis import after_class from proboscis.asserts import assert_equal from proboscis.asserts import assert_raises -from reddwarf.common import exception -from reddwarf.extensions.mgmt.instances.service import MgmtInstanceController +from trove.common import exception +from trove.extensions.mgmt.instances.service import MgmtInstanceController GROUP = "dbaas.api.mgmt.action.reset-task-status" @@ -43,7 +43,7 @@ class MgmtInstanceBase(object): self.db_info.delete() def _create_instance(self): - self.context = ReddwarfContext(is_admin=True) + self.context = TroveContext(is_admin=True) self.tenant_id = 999 self.db_info = DBInstance.create( name="instance", @@ -61,7 +61,7 @@ class MgmtInstanceBase(object): from webob import Request path = '/' print "path:", path - return Request.blank(path=path, environ={'reddwarf.context': context}, + return Request.blank(path=path, environ={'trove.context': context}, **kwargs) def _reload_db_info(self): @@ -106,7 +106,7 @@ class RestartTaskStatusTests(MgmtInstanceBase): @test def mgmt_restart_task_requires_admin_account(self): - context = ReddwarfContext(is_admin=False) + context = TroveContext(is_admin=False) req, body = self._make_request(context=context) self.controller = MgmtInstanceController() assert_raises(exception.Forbidden, self.controller.action, diff --git a/reddwarf/tests/api/mgmt/malformed_json.py b/trove/tests/api/mgmt/malformed_json.py similarity index 95% rename from reddwarf/tests/api/mgmt/malformed_json.py rename to trove/tests/api/mgmt/malformed_json.py index b28f76f8de..7b25667712 100644 --- a/reddwarf/tests/api/mgmt/malformed_json.py +++ b/trove/tests/api/mgmt/malformed_json.py @@ -3,16 +3,16 @@ from proboscis.asserts import * from proboscis import after_class from proboscis import before_class from proboscis.asserts import Check -from reddwarf.tests.config import CONFIG -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.api.instances import VOLUME_SUPPORT -from reddwarfclient import exceptions +from trove.tests.config import CONFIG +from trove.tests.api.instances import instance_info +from trove.tests.api.instances import VOLUME_SUPPORT +from troveclient import exceptions import json import requests -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import poll_until +from trove.tests.util.users import Requirements +from trove.tests.util import create_dbaas_client +from trove.tests.util import poll_until from nose.plugins.skip import SkipTest diff --git a/reddwarf/tests/api/mgmt/quotas.py b/trove/tests/api/mgmt/quotas.py similarity index 84% rename from reddwarf/tests/api/mgmt/quotas.py rename to trove/tests/api/mgmt/quotas.py index 2fc7cb1746..0896441715 100644 --- a/reddwarf/tests/api/mgmt/quotas.py +++ b/trove/tests/api/mgmt/quotas.py @@ -3,14 +3,14 @@ from proboscis.asserts import * from proboscis import after_class from proboscis import before_class from proboscis.asserts import Check -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util import create_client -from reddwarf.tests.util import get_standby_instance_flavor -from reddwarf.tests.util.users import Requirements -from reddwarf.tests.config import CONFIG -from reddwarf.tests.util.check import AttrCheck -from reddwarf.tests.util.check import TypeCheck -from reddwarfclient import exceptions +from trove.tests.util import create_dbaas_client +from trove.tests.util import create_client +from trove.tests.util import get_standby_instance_flavor +from trove.tests.util.users import Requirements +from trove.tests.config import CONFIG +from trove.tests.util.check import AttrCheck +from trove.tests.util.check import TypeCheck +from troveclient import exceptions class QuotasBase(object): @@ -24,8 +24,8 @@ class QuotasBase(object): self.client2 = create_dbaas_client(self.user2) self.mgmt_client = create_client(is_admin=True) ''' Orig quotas from config - "reddwarf_max_instances_per_user": 55, - "reddwarf_max_volumes_per_user": 100, ''' + "trove_max_instances_per_user": 55, + "trove_max_volumes_per_user": 100, ''' self.original_quotas1 = self.mgmt_client.quota.show(self.user1.tenant) self.original_quotas2 = self.mgmt_client.quota.show(self.user2.tenant) @@ -51,9 +51,9 @@ class DefaultQuotasTest(QuotasBase): def check_quotas_are_set_to_defaults(self): quotas = self.mgmt_client.quota.show(self.user1.tenant) with Check() as check: - check.equal(CONFIG.reddwarf_max_instances_per_user, + check.equal(CONFIG.trove_max_instances_per_user, quotas["instances"]) - check.equal(CONFIG.reddwarf_max_volumes_per_user, + check.equal(CONFIG.trove_max_volumes_per_user, quotas["volumes"]) assert_equal(len(quotas), 2) @@ -84,7 +84,7 @@ class ChangeInstancesQuota(QuotasBase): quotas = self.mgmt_client.quota.show(self.user1.tenant) with Check() as check: check.equal(0, quotas["instances"]) - check.equal(CONFIG.reddwarf_max_volumes_per_user, + check.equal(CONFIG.trove_max_volumes_per_user, quotas["volumes"]) assert_equal(len(quotas), 2) @@ -119,7 +119,7 @@ class ChangeVolumesQuota(QuotasBase): self.client1.instances.create, "too_large_volume", flavor_href, - {'size': CONFIG.reddwarf_max_accepted_volume_size + 1}) + {'size': CONFIG.trove_max_accepted_volume_size + 1}) assert_equal(413, self.client1.last_http_code) @test @@ -134,7 +134,7 @@ class ChangeVolumesQuota(QuotasBase): def verify_correct_update(self): quotas = self.mgmt_client.quota.show(self.user1.tenant) with Check() as check: - check.equal(CONFIG.reddwarf_max_instances_per_user, + check.equal(CONFIG.trove_max_instances_per_user, quotas["instances"]) check.equal(0, quotas["volumes"]) assert_equal(len(quotas), 2) @@ -146,7 +146,7 @@ class ChangeVolumesQuota(QuotasBase): self.client1.instances.create, "too_large_volume", flavor_href, - {'size': CONFIG.reddwarf_max_accepted_volume_size + 1}) + {'size': CONFIG.trove_max_accepted_volume_size + 1}) assert_equal(413, self.client1.last_http_code) #create an instance when I set the limit back to diff --git a/reddwarf/tests/api/mgmt/storage.py b/trove/tests/api/mgmt/storage.py similarity index 92% rename from reddwarf/tests/api/mgmt/storage.py rename to trove/tests/api/mgmt/storage.py index 447b3b348a..9aabb80e0b 100644 --- a/reddwarf/tests/api/mgmt/storage.py +++ b/trove/tests/api/mgmt/storage.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarfclient import exceptions +from troveclient import exceptions from nose.plugins.skip import SkipTest @@ -20,12 +20,12 @@ from proboscis import before_class from proboscis import test from proboscis.asserts import * -from reddwarf import tests -from reddwarf.tests.api.instances import CheckInstance -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests.util import test_config -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util.users import Requirements +from trove import tests +from trove.tests.api.instances import CheckInstance +from trove.tests.api.instances import instance_info +from trove.tests.util import test_config +from trove.tests.util import create_dbaas_client +from trove.tests.util.users import Requirements FAKE_MODE = test_config.values['fake_mode'] GROUP = "dbaas.api.mgmt.storage" diff --git a/reddwarf/tests/api/root.py b/trove/tests/api/root.py similarity index 95% rename from reddwarf/tests/api/root.py rename to trove/tests/api/root.py index b631f993b4..125c3cf03d 100644 --- a/reddwarf/tests/api/root.py +++ b/trove/tests/api/root.py @@ -14,7 +14,7 @@ import time -from reddwarfclient import exceptions +from troveclient import exceptions from nose.plugins.skip import SkipTest from proboscis import before_class @@ -28,13 +28,13 @@ from proboscis.asserts import fail from proboscis.decorators import expect_exception from proboscis.decorators import time_out -from reddwarf import tests -from reddwarf.tests.api.users import TestUsers -from reddwarf.tests.api.instances import GROUP_START -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests import util -from reddwarf.tests.util import test_config -from reddwarf.tests.api.databases import TestMysqlAccess +from trove import tests +from trove.tests.api.users import TestUsers +from trove.tests.api.instances import GROUP_START +from trove.tests.api.instances import instance_info +from trove.tests import util +from trove.tests.util import test_config +from trove.tests.api.databases import TestMysqlAccess GROUP = "dbaas.api.root" diff --git a/reddwarf/tests/api/user_access.py b/trove/tests/api/user_access.py similarity index 98% rename from reddwarf/tests/api/user_access.py rename to trove/tests/api/user_access.py index 32b46f2d13..b8baac7bbb 100644 --- a/reddwarf/tests/api/user_access.py +++ b/trove/tests/api/user_access.py @@ -16,18 +16,18 @@ import time import re from random import choice -from reddwarfclient import exceptions +from troveclient import exceptions from proboscis import after_class from proboscis import before_class from proboscis import test from proboscis.asserts import * -from reddwarf import tests -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests import util -from reddwarf.tests.util import test_config -from reddwarf.tests.api.users import TestUsers +from trove import tests +from trove.tests.api.instances import instance_info +from trove.tests import util +from trove.tests.util import test_config +from trove.tests.api.users import TestUsers GROUP = "dbaas.api.useraccess" GROUP_POSITIVE = GROUP + ".positive" diff --git a/reddwarf/tests/api/users.py b/trove/tests/api/users.py similarity index 97% rename from reddwarf/tests/api/users.py rename to trove/tests/api/users.py index c758d2e504..607db0dd2e 100644 --- a/reddwarf/tests/api/users.py +++ b/trove/tests/api/users.py @@ -15,7 +15,7 @@ import time import re -from reddwarfclient import exceptions +from troveclient import exceptions from proboscis import after_class from proboscis import before_class @@ -29,14 +29,14 @@ from proboscis.asserts import fail from proboscis.decorators import expect_exception from proboscis.decorators import time_out -from reddwarf import tests -from reddwarf.tests.api.databases import TestDatabases -from reddwarf.tests.api.instances import GROUP_START -from reddwarf.tests.api.instances import instance_info -from reddwarf.tests import util -from reddwarf.tests.util import skip_if_xml -from reddwarf.tests.util import test_config -from reddwarf.tests.api.databases import TestMysqlAccess +from trove import tests +from trove.tests.api.databases import TestDatabases +from trove.tests.api.instances import GROUP_START +from trove.tests.api.instances import instance_info +from trove.tests import util +from trove.tests.util import skip_if_xml +from trove.tests.util import test_config +from trove.tests.api.databases import TestMysqlAccess from urllib import quote diff --git a/reddwarf/tests/api/versions.py b/trove/tests/api/versions.py similarity index 89% rename from reddwarf/tests/api/versions.py rename to trove/tests/api/versions.py index 9d318e368b..a40e206c02 100644 --- a/reddwarf/tests/api/versions.py +++ b/trove/tests/api/versions.py @@ -17,11 +17,11 @@ from proboscis import test from proboscis.asserts import assert_equal from proboscis import SkipTest -from reddwarfclient.exceptions import ClientException -from reddwarf import tests -from reddwarf.tests.util import test_config -from reddwarf.tests.util import create_dbaas_client -from reddwarf.tests.util.users import Requirements +from troveclient.exceptions import ClientException +from trove import tests +from trove.tests.util import test_config +from trove.tests.util import create_dbaas_client +from trove.tests.util.users import Requirements GROUP = "dbaas.api.versions" @@ -43,10 +43,10 @@ class Versions(object): assert_equal(1, len(versions)) assert_equal("CURRENT", versions[0].status, message="Version status: %s" % versions[0].status) - expected_version = test_config.values['reddwarf_version'] + expected_version = test_config.values['trove_version'] assert_equal(expected_version, versions[0].id, message="Version ID: %s" % versions[0].id) - expected_api_updated = test_config.values['reddwarf_api_updated'] + expected_api_updated = test_config.values['trove_api_updated'] assert_equal(expected_api_updated, versions[0].updated, message="Version updated: %s" % versions[0].updated) diff --git a/reddwarf/tests/config.py b/trove/tests/config.py similarity index 93% rename from reddwarf/tests/config.py rename to trove/tests/config.py index babcc90e23..1fa6565005 100644 --- a/reddwarf/tests/config.py +++ b/trove/tests/config.py @@ -24,7 +24,7 @@ environments if we choose to. import json import os from collections import Mapping -from reddwarf.tests.fakes.common import event_simulator_sleep +from trove.tests.fakes.common import event_simulator_sleep #TODO(tim.simpson): I feel like this class already exists somewhere in core @@ -48,7 +48,7 @@ class FrozenDict(Mapping): USAGE_ENDPOINT = os.environ.get("USAGE_ENDPOINT", - "reddwarf.tests.util.usage.UsageVerifier") + "trove.tests.util.usage.UsageVerifier") class TestConfig(object): @@ -67,7 +67,7 @@ class TestConfig(object): 'clean_slate': os.environ.get("CLEAN_SLATE", "False") == "True", 'fake_mode': os.environ.get("FAKE_MODE", "False") == "True", 'nova_auth_url': "http://localhost:5000/v2.0", - 'reddwarf_auth_url': "http://localhost:5000/v2.0/tokens", + 'trove_auth_url': "http://localhost:5000/v2.0/tokens", 'dbaas_url': "http://localhost:8775/v1.0/dbaas", 'version_url': "http://localhost:8775/", 'nova_url': "http://localhost:8774/v1.1", @@ -83,8 +83,8 @@ class TestConfig(object): "report_directory": os.environ.get("REPORT_DIRECTORY", None), "sleep_mode": "simulated", "simulate_events": False, - "reddwarf_volume_support": True, - "reddwarf_max_volumes_per_user": 100, + "trove_volume_support": True, + "trove_max_volumes_per_user": 100, "usage_endpoint": USAGE_ENDPOINT, } self._frozen_values = FrozenDict(self._values) @@ -159,7 +159,7 @@ class TestConfig(object): @property def users(self): if self._users is None: - from reddwarf.tests.util.users import Users + from trove.tests.util.users import Users self._users = Users(self.values['users']) return self._users diff --git a/reddwarf/tests/fakes/__init__.py b/trove/tests/fakes/__init__.py similarity index 100% rename from reddwarf/tests/fakes/__init__.py rename to trove/tests/fakes/__init__.py diff --git a/reddwarf/tests/fakes/common.py b/trove/tests/fakes/common.py similarity index 96% rename from reddwarf/tests/fakes/common.py rename to trove/tests/fakes/common.py index 6f1ed9e02a..b814a3b857 100644 --- a/reddwarf/tests/fakes/common.py +++ b/trove/tests/fakes/common.py @@ -20,8 +20,8 @@ import time from novaclient import exceptions as nova_exceptions -from reddwarf.common import cfg -from reddwarf.openstack.common import log as logging +from trove.common import cfg +from trove.openstack.common import log as logging CONF = cfg.CONF diff --git a/reddwarf/tests/fakes/guestagent.py b/trove/tests/fakes/guestagent.py similarity index 93% rename from reddwarf/tests/fakes/guestagent.py rename to trove/tests/fakes/guestagent.py index 7428534de7..e8f4cb2632 100644 --- a/reddwarf/tests/fakes/guestagent.py +++ b/trove/tests/fakes/guestagent.py @@ -15,13 +15,13 @@ # 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 time import re -from reddwarf.tests.fakes.common import get_event_spawer -from reddwarf.common import exception as rd_exception -from reddwarf.tests.util import unquote_user_host +from trove.tests.fakes.common import get_event_spawer +from trove.common import exception as rd_exception +from trove.tests.util import unquote_user_host DB = {} LOG = logging.getLogger(__name__) @@ -182,10 +182,10 @@ class FakeGuest(object): def prepare(self, memory_mb, databases, users, device_path=None, mount_point=None, backup_id=None): - from reddwarf.instance.models import DBInstance - from reddwarf.instance.models import InstanceServiceStatus - from reddwarf.instance.models import ServiceStatuses - from reddwarf.guestagent.models import AgentHeartBeat + from trove.instance.models import DBInstance + from trove.instance.models import InstanceServiceStatus + from trove.instance.models import ServiceStatuses + from trove.guestagent.models import AgentHeartBeat LOG.debug("users... %s" % users) LOG.debug("databases... %s" % databases) instance_name = DBInstance.find_by(id=self.id).name @@ -203,8 +203,8 @@ class FakeGuest(object): self.event_spawn(1.0, update_db) def _set_status(self, new_status='RUNNING'): - from reddwarf.instance.models import InstanceServiceStatus - from reddwarf.instance.models import ServiceStatuses + from trove.instance.models import InstanceServiceStatus + from trove.instance.models import ServiceStatuses print("Setting status to %s" % new_status) states = {'RUNNING': ServiceStatuses.RUNNING, 'SHUTDOWN': ServiceStatuses.SHUTDOWN, @@ -268,7 +268,7 @@ class FakeGuest(object): return dbs def create_backup(self, backup_id): - from reddwarf.backup.models import Backup, BackupState + from trove.backup.models import Backup, BackupState backup = Backup.get_by_id(backup_id) def finish_create_backup(): diff --git a/reddwarf/tests/fakes/keystone.py b/trove/tests/fakes/keystone.py similarity index 100% rename from reddwarf/tests/fakes/keystone.py rename to trove/tests/fakes/keystone.py diff --git a/reddwarf/tests/fakes/nova.py b/trove/tests/fakes/nova.py similarity index 98% rename from reddwarf/tests/fakes/nova.py rename to trove/tests/fakes/nova.py index dcd5d699aa..c808a95aa1 100644 --- a/reddwarf/tests/fakes/nova.py +++ b/trove/tests/fakes/nova.py @@ -17,11 +17,11 @@ from novaclient import exceptions as nova_exceptions from novaclient.v1_1.client import Client -from reddwarf.common.exception import PollTimeOut -from reddwarf.common.utils import poll_until -from reddwarf.openstack.common import log as logging -from reddwarf.tests.fakes.common import authorize -from reddwarf.tests.fakes.common import get_event_spawer +from trove.common.exception import PollTimeOut +from trove.common.utils import poll_until +from trove.openstack.common import log as logging +from trove.tests.fakes.common import authorize +from trove.tests.fakes.common import get_event_spawer import eventlet import uuid @@ -331,9 +331,9 @@ class FakeServers(object): self.event_spawn(time_from_now, delete_server) def schedule_simulate_running_server(self, id, time_from_now): - from reddwarf.instance.models import DBInstance - from reddwarf.instance.models import InstanceServiceStatus - from reddwarf.instance.models import ServiceStatuses + from trove.instance.models import DBInstance + from trove.instance.models import InstanceServiceStatus + from trove.instance.models import ServiceStatuses def set_server_running(): instance = DBInstance.find_by(compute_instance_id=id) diff --git a/reddwarf/tests/fakes/swift.py b/trove/tests/fakes/swift.py similarity index 100% rename from reddwarf/tests/fakes/swift.py rename to trove/tests/fakes/swift.py diff --git a/reddwarf/tests/unittests/__init__.py b/trove/tests/unittests/__init__.py similarity index 100% rename from reddwarf/tests/unittests/__init__.py rename to trove/tests/unittests/__init__.py diff --git a/reddwarf/tests/unittests/api/__init__.py b/trove/tests/unittests/api/__init__.py similarity index 100% rename from reddwarf/tests/unittests/api/__init__.py rename to trove/tests/unittests/api/__init__.py diff --git a/reddwarf/tests/unittests/api/common/__init__.py b/trove/tests/unittests/api/common/__init__.py similarity index 100% rename from reddwarf/tests/unittests/api/common/__init__.py rename to trove/tests/unittests/api/common/__init__.py diff --git a/reddwarf/tests/unittests/api/common/test_limits.py b/trove/tests/unittests/api/common/test_limits.py similarity index 98% rename from reddwarf/tests/unittests/api/common/test_limits.py rename to trove/tests/unittests/api/common/test_limits.py index 1da953bea7..bcf4e3b3c9 100644 --- a/reddwarf/tests/unittests/api/common/test_limits.py +++ b/trove/tests/unittests/api/common/test_limits.py @@ -20,17 +20,17 @@ Tests dealing with HTTP rate-limiting. import httplib import StringIO from xml.dom import minidom -from reddwarf.quota.models import Quota +from trove.quota.models import Quota import testtools import webob from mockito import when, mock, any -from reddwarf.common import limits -from reddwarf.common.limits import Limit -from reddwarf.limits import views -from reddwarf.limits.service import LimitsController -from reddwarf.openstack.common import jsonutils -from reddwarf.quota.quota import QUOTAS +from trove.common import limits +from trove.common.limits import Limit +from trove.limits import views +from trove.limits.service import LimitsController +from trove.openstack.common import jsonutils +from trove.quota.quota import QUOTAS TEST_LIMITS = [ Limit("GET", "/delayed", "^/delayed", 1, limits.PER_MINUTE), @@ -120,7 +120,7 @@ class LimitsControllerTest(BaseLimitTestSuite): hard_limit=55)} req = mock() - req.environ = {"reddwarf.limits": limits} + req.environ = {"trove.limits": limits} when(QUOTAS).get_all_quotas_by_tenant(tenant_id).thenReturn(abs_limits) view = limit_controller.index(req, tenant_id) diff --git a/reddwarf/tests/unittests/api/test_versions.py b/trove/tests/unittests/api/test_versions.py similarity index 97% rename from reddwarf/tests/unittests/api/test_versions.py rename to trove/tests/unittests/api/test_versions.py index 35210ab147..0c7f7c1d7a 100644 --- a/reddwarf/tests/unittests/api/test_versions.py +++ b/trove/tests/unittests/api/test_versions.py @@ -16,13 +16,13 @@ # under the License. from mock import Mock, MagicMock -from reddwarf.versions import BaseVersion -from reddwarf.versions import Version -from reddwarf.versions import VersionDataView -from reddwarf.versions import VersionsAPI -from reddwarf.versions import VersionsController -from reddwarf.versions import VersionsDataView -from reddwarf.versions import VERSIONS +from trove.versions import BaseVersion +from trove.versions import Version +from trove.versions import VersionDataView +from trove.versions import VersionsAPI +from trove.versions import VersionsController +from trove.versions import VersionsDataView +from trove.versions import VERSIONS from xml.dom import minidom import testtools diff --git a/reddwarf/tests/unittests/backup/__init__.py b/trove/tests/unittests/backup/__init__.py similarity index 100% rename from reddwarf/tests/unittests/backup/__init__.py rename to trove/tests/unittests/backup/__init__.py diff --git a/reddwarf/tests/unittests/backup/test_backup_models.py b/trove/tests/unittests/backup/test_backup_models.py similarity index 95% rename from reddwarf/tests/unittests/backup/test_backup_models.py rename to trove/tests/unittests/backup/test_backup_models.py index 4a9b5cee5a..4d45fbe6f1 100644 --- a/reddwarf/tests/unittests/backup/test_backup_models.py +++ b/trove/tests/unittests/backup/test_backup_models.py @@ -13,18 +13,18 @@ import testtools -from reddwarf.backup import models -from reddwarf.tests.unittests.util import util -from reddwarf.common import utils, exception -from reddwarf.common.context import ReddwarfContext -from reddwarf.instance.models import BuiltInstance, InstanceTasks, Instance +from trove.backup import models +from trove.tests.unittests.util import util +from trove.common import utils, exception +from trove.common.context import TroveContext +from trove.instance.models import BuiltInstance, InstanceTasks, Instance from mockito import mock, when, unstub, any -from reddwarf.taskmanager import api +from trove.taskmanager import api def _prep_conf(current_time): current_time = str(current_time) - context = ReddwarfContext(tenant='TENANT-' + current_time) + context = TroveContext(tenant='TENANT-' + current_time) instance_id = 'INSTANCE-' + current_time return context, instance_id diff --git a/reddwarf/tests/unittests/backup/test_backupagent.py b/trove/tests/unittests/backup/test_backupagent.py similarity index 90% rename from reddwarf/tests/unittests/backup/test_backupagent.py rename to trove/tests/unittests/backup/test_backupagent.py index 1d1e82b498..5025199de5 100644 --- a/reddwarf/tests/unittests/backup/test_backupagent.py +++ b/trove/tests/unittests/backup/test_backupagent.py @@ -13,22 +13,22 @@ #limitations under the License. import hashlib -from reddwarf.common import utils -from reddwarf.common.context import ReddwarfContext -from reddwarf.guestagent.strategies.restore.base import RestoreRunner +from trove.common import utils +from trove.common.context import TroveContext +from trove.guestagent.strategies.restore.base import RestoreRunner import testtools from testtools.matchers import Equals, Is from webob.exc import HTTPNotFound from mockito import when, verify, unstub, mock, any, contains -from reddwarf.backup.models import DBBackup -from reddwarf.backup.models import BackupState -from reddwarf.common.exception import ModelNotFoundError -from reddwarf.db.models import DatabaseModelBase -from reddwarf.guestagent.backup import backupagent -from reddwarf.guestagent.strategies.backup.base import BackupRunner -from reddwarf.guestagent.strategies.backup.base import UnknownBackupType -from reddwarf.guestagent.strategies.storage.base import Storage +from trove.backup.models import DBBackup +from trove.backup.models import BackupState +from trove.common.exception import ModelNotFoundError +from trove.db.models import DatabaseModelBase +from trove.guestagent.backup import backupagent +from trove.guestagent.strategies.backup.base import BackupRunner +from trove.guestagent.strategies.backup.base import UnknownBackupType +from trove.guestagent.strategies.storage.base import Storage def create_fake_data(): @@ -129,7 +129,7 @@ class MockRestoreRunner(RestoreRunner): def is_zipped(self): return False -BACKUP_NS = 'reddwarf.guestagent.strategies.backup' +BACKUP_NS = 'trove.guestagent.strategies.backup' class BackupAgentTest(testtools.TestCase): @@ -218,7 +218,7 @@ class BackupAgentTest(testtools.TestCase): agent = backupagent.BackupAgent() - agent.execute_restore(ReddwarfContext(), '123', '/var/lib/mysql') + agent.execute_restore(TroveContext(), '123', '/var/lib/mysql') def test_restore_unknown(self): backup = mock(DBBackup) diff --git a/reddwarf/tests/unittests/backup/test_storage.py b/trove/tests/unittests/backup/test_storage.py similarity index 100% rename from reddwarf/tests/unittests/backup/test_storage.py rename to trove/tests/unittests/backup/test_storage.py diff --git a/reddwarf/tests/unittests/common/__init__.py b/trove/tests/unittests/common/__init__.py similarity index 100% rename from reddwarf/tests/unittests/common/__init__.py rename to trove/tests/unittests/common/__init__.py diff --git a/reddwarf/tests/unittests/common/test_remote.py b/trove/tests/unittests/common/test_remote.py similarity index 96% rename from reddwarf/tests/unittests/common/test_remote.py rename to trove/tests/unittests/common/test_remote.py index ddb7bc1161..20496910ac 100644 --- a/reddwarf/tests/unittests/common/test_remote.py +++ b/trove/tests/unittests/common/test_remote.py @@ -4,9 +4,9 @@ from testtools.matchers import * import swiftclient.client -from reddwarf.tests.fakes.swift import SwiftClientStub -from reddwarf.common.context import ReddwarfContext -from reddwarf.common import remote +from trove.tests.fakes.swift import SwiftClientStub +from trove.common.context import TroveContext +from trove.common import remote class TestRemote(testtools.TestCase): @@ -26,7 +26,7 @@ class TestRemote(testtools.TestCase): mock_resp = mock(dict) when(swiftclient.client.Connection).get_container('bob').thenReturn( ["text", mock_resp]) - client = remote.create_swift_client(ReddwarfContext(tenant='123')) + client = remote.create_swift_client(TroveContext(tenant='123')) headers, container = client.get_container('bob') self.assertIs(headers, "text") self.assertIs(container, mock_resp) @@ -168,7 +168,7 @@ class TestRemote(testtools.TestCase): """ when a container does not exist and is accessed then a 404 is returned """ - from reddwarf.tests.fakes.swift import SwiftClientStub + from trove.tests.fakes.swift import SwiftClientStub swift_stub = SwiftClientStub() swift_stub.with_account('123223') @@ -200,7 +200,7 @@ class TestRemote(testtools.TestCase): # set expected behavior - trivial here since it is the intended # behavior however keep in mind this is just to support testing of - # reddwarf components + # trove components swift_stub.with_object('new-container', 'new-object', 'updated-object-contents') diff --git a/reddwarf/tests/unittests/guestagent/__init__.py b/trove/tests/unittests/guestagent/__init__.py similarity index 100% rename from reddwarf/tests/unittests/guestagent/__init__.py rename to trove/tests/unittests/guestagent/__init__.py diff --git a/reddwarf/tests/unittests/guestagent/test_api.py b/trove/tests/unittests/guestagent/test_api.py similarity index 98% rename from reddwarf/tests/unittests/guestagent/test_api.py rename to trove/tests/unittests/guestagent/test_api.py index e4091ffbf9..387f1dbd79 100644 --- a/reddwarf/tests/unittests/guestagent/test_api.py +++ b/trove/tests/unittests/guestagent/test_api.py @@ -21,11 +21,11 @@ from mockito import never import mockito.matchers import testtools from testtools.matchers import KeysEqual, Is -from reddwarf.guestagent import models as agent_models -import reddwarf.db.models as db_models -from reddwarf.common import exception -from reddwarf.guestagent import api -import reddwarf.openstack.common.rpc as rpc +from trove.guestagent import models as agent_models +import trove.db.models as db_models +from trove.common import exception +from trove.guestagent import api +import trove.openstack.common.rpc as rpc class ApiTest(testtools.TestCase): diff --git a/reddwarf/tests/unittests/guestagent/test_dbaas.py b/trove/tests/unittests/guestagent/test_dbaas.py similarity index 96% rename from reddwarf/tests/unittests/guestagent/test_dbaas.py rename to trove/tests/unittests/guestagent/test_dbaas.py index f26ad1c392..a3bcb8e371 100644 --- a/reddwarf/tests/unittests/guestagent/test_dbaas.py +++ b/trove/tests/unittests/guestagent/test_dbaas.py @@ -28,27 +28,27 @@ from mockito import contains from mockito import never from mockito import matchers from mockito import inorder, verifyNoMoreInteractions -from reddwarf.extensions.mysql.models import RootHistory +from trove.extensions.mysql.models import RootHistory import sqlalchemy import testtools from testtools.matchers import Is from testtools.matchers import Equals from testtools.matchers import Not -import reddwarf -from reddwarf.common.context import ReddwarfContext -from reddwarf.guestagent import pkg -from reddwarf.common import utils -import reddwarf.guestagent.manager.mysql_service as dbaas -from reddwarf.guestagent.manager.mysql_service import MySqlAdmin -from reddwarf.guestagent.manager.mysql_service import MySqlRootAccess -from reddwarf.guestagent.manager.mysql_service import MySqlApp -from reddwarf.guestagent.manager.mysql_service import MySqlAppStatus -from reddwarf.guestagent.manager.mysql_service import KeepAliveConnection -from reddwarf.guestagent.dbaas import Interrogator -from reddwarf.guestagent.db import models -from reddwarf.instance.models import ServiceStatuses -from reddwarf.instance.models import InstanceServiceStatus -from reddwarf.tests.unittests.util import util +import trove +from trove.common.context import TroveContext +from trove.guestagent import pkg +from trove.common import utils +import trove.guestagent.manager.mysql_service as dbaas +from trove.guestagent.manager.mysql_service import MySqlAdmin +from trove.guestagent.manager.mysql_service import MySqlRootAccess +from trove.guestagent.manager.mysql_service import MySqlApp +from trove.guestagent.manager.mysql_service import MySqlAppStatus +from trove.guestagent.manager.mysql_service import KeepAliveConnection +from trove.guestagent.dbaas import Interrogator +from trove.guestagent.db import models +from trove.instance.models import ServiceStatuses +from trove.instance.models import InstanceServiceStatus +from trove.tests.unittests.util import util """ @@ -125,7 +125,7 @@ class DbaasTest(testtools.TestCase): def test_load_mysqld_options_error(self): - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError dbaas.utils.execute = Mock(side_effect=ProcessExecutionError()) self.assertFalse(dbaas.load_mysqld_options()) @@ -539,7 +539,7 @@ class MySqlAppTest(testtools.TestCase): def test_wipe_ib_logfiles_no_file(self): - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError processexecerror = ProcessExecutionError('No such file or directory') dbaas.utils.execute_with_timeout = Mock(side_effect=processexecerror) @@ -547,7 +547,7 @@ class MySqlAppTest(testtools.TestCase): def test_wipe_ib_logfiles_error(self): - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError mocked = Mock(side_effect=ProcessExecutionError('Error')) dbaas.utils.execute_with_timeout = mocked @@ -582,7 +582,7 @@ class MySqlAppTest(testtools.TestCase): def test_start_mysql_error(self): self.mySqlApp._enable_mysql_on_boot = Mock() - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError mocked = Mock(side_effect=ProcessExecutionError('Error')) dbaas.utils.execute_with_timeout = mocked @@ -650,7 +650,7 @@ class MySqlAppInstallTest(MySqlAppTest): def test_install_install_error(self): - from reddwarf.guestagent import pkg + from trove.guestagent import pkg self.mySqlApp.start_mysql = Mock() self.mySqlApp.stop_db = Mock() self.mySqlApp.is_installed = Mock(return_value=False) @@ -664,7 +664,7 @@ class MySqlAppInstallTest(MySqlAppTest): def test_secure_write_conf_error(self): - from reddwarf.guestagent import pkg + from trove.guestagent import pkg self.mySqlApp.start_mysql = Mock() self.mySqlApp.stop_db = Mock() self.mySqlApp._write_mycnf = \ @@ -846,13 +846,13 @@ class MySqlRootStatusTest(testtools.TestCase): def test_report_root_enabled(self): mock_db_api = mock() - when(reddwarf.extensions.mysql.models).get_db_api().thenReturn( + when(trove.extensions.mysql.models).get_db_api().thenReturn( mock_db_api) when(mock_db_api).find_by(any(), id=None).thenReturn(None) root_history = RootHistory('x', 'root') when(mock_db_api).save(any(RootHistory)).thenReturn(root_history) # invocation - history = MySqlRootAccess.report_root_enabled(ReddwarfContext()) + history = MySqlRootAccess.report_root_enabled(TroveContext()) # verification self.assertThat(history, Is(root_history)) verify(mock_db_api).save(any(RootHistory)) @@ -1033,7 +1033,7 @@ class MySqlAppStatusTest(testtools.TestCase): def test_get_actual_db_status_error_shutdown(self): - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError mocked = Mock(side_effect=ProcessExecutionError()) dbaas.utils.execute_with_timeout = mocked dbaas.load_mysqld_options = Mock() @@ -1046,7 +1046,7 @@ class MySqlAppStatusTest(testtools.TestCase): def test_get_actual_db_status_error_crashed(self): - from reddwarf.common.exception import ProcessExecutionError + from trove.common.exception import ProcessExecutionError dbaas.utils.execute_with_timeout = \ MagicMock(side_effect=[ProcessExecutionError(), ("some output", None)]) diff --git a/reddwarf/tests/unittests/guestagent/test_dbmodels.py b/trove/tests/unittests/guestagent/test_dbmodels.py similarity index 94% rename from reddwarf/tests/unittests/guestagent/test_dbmodels.py rename to trove/tests/unittests/guestagent/test_dbmodels.py index 1cdf4d90ca..8b1dd69632 100644 --- a/reddwarf/tests/unittests/guestagent/test_dbmodels.py +++ b/trove/tests/unittests/guestagent/test_dbmodels.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License import testtools -from reddwarf.guestagent.db import models as dbmodels +from trove.guestagent.db import models as dbmodels from mock import Mock, MagicMock @@ -75,12 +75,12 @@ class IsValidUsernameTest(testtools.TestCase): self.mysqlUser._ignore_users = self.origin_ignore_users def test_is_valid_user_name(self): - value = "reddwarf" + value = "trove" self.assertTrue(self.mysqlUser._is_valid_user_name(value)) def test_is_valid_user_name_negative(self): self.mysqlUser._is_valid = MagicMock(return_value=False) - self.assertFalse(self.mysqlUser._is_valid_user_name("reddwarf")) + self.assertFalse(self.mysqlUser._is_valid_user_name("trove")) self.mysqlUser._is_valid = MagicMock(return_value=True) self.assertFalse(self.mysqlUser._is_valid_user_name("king")) diff --git a/reddwarf/tests/unittests/guestagent/test_manager.py b/trove/tests/unittests/guestagent/test_manager.py similarity index 95% rename from reddwarf/tests/unittests/guestagent/test_manager.py rename to trove/tests/unittests/guestagent/test_manager.py index 630f3ca32c..c5b38f7434 100644 --- a/reddwarf/tests/unittests/guestagent/test_manager.py +++ b/trove/tests/unittests/guestagent/test_manager.py @@ -12,27 +12,27 @@ # License for the specific language governing permissions and limitations # under the License -from reddwarf.guestagent import volume +from trove.guestagent import volume import testtools -from reddwarf.instance import models as rd_models +from trove.instance import models as rd_models import os from mockito import verify, when, unstub, any, mock, never import testtools from testtools.matchers import Is, Equals, Not -from reddwarf.common.context import ReddwarfContext +from trove.common.context import TroveContext -from reddwarf.guestagent.manager.mysql import Manager -import reddwarf.guestagent.manager.mysql_service as dbaas -from reddwarf.guestagent import backup -from reddwarf.guestagent.volume import VolumeDevice +from trove.guestagent.manager.mysql import Manager +import trove.guestagent.manager.mysql_service as dbaas +from trove.guestagent import backup +from trove.guestagent.volume import VolumeDevice class GuestAgentManagerTest(testtools.TestCase): def setUp(self): super(GuestAgentManagerTest, self).setUp() - self.context = ReddwarfContext() + self.context = TroveContext() self.manager = Manager() self.origin_MySqlAppStatus = dbaas.MySqlAppStatus self.origin_os_path_exists = os.path.exists diff --git a/reddwarf/tests/unittests/guestagent/test_models.py b/trove/tests/unittests/guestagent/test_models.py similarity index 94% rename from reddwarf/tests/unittests/guestagent/test_models.py rename to trove/tests/unittests/guestagent/test_models.py index ed2f650a2a..9eca7c6661 100644 --- a/reddwarf/tests/unittests/guestagent/test_models.py +++ b/trove/tests/unittests/guestagent/test_models.py @@ -14,10 +14,10 @@ import testtools from mock import Mock, MagicMock -from reddwarf.guestagent import models -from reddwarf.common import utils -from reddwarf.db.sqlalchemy import api as dbapi -from reddwarf.db import models as dbmodels +from trove.guestagent import models +from trove.common import utils +from trove.db.sqlalchemy import api as dbapi +from trove.db import models as dbmodels from datetime import datetime diff --git a/reddwarf/tests/unittests/guestagent/test_pkg.py b/trove/tests/unittests/guestagent/test_pkg.py similarity index 98% rename from reddwarf/tests/unittests/guestagent/test_pkg.py rename to trove/tests/unittests/guestagent/test_pkg.py index 7313113e86..18871e1ea9 100644 --- a/reddwarf/tests/unittests/guestagent/test_pkg.py +++ b/trove/tests/unittests/guestagent/test_pkg.py @@ -18,9 +18,9 @@ import testtools from mock import Mock import pexpect -from reddwarf.common import utils -from reddwarf.common import exception -from reddwarf.guestagent import pkg +from trove.common import utils +from trove.common import exception +from trove.guestagent import pkg import commands import re diff --git a/reddwarf/tests/unittests/guestagent/test_query.py b/trove/tests/unittests/guestagent/test_query.py similarity index 99% rename from reddwarf/tests/unittests/guestagent/test_query.py rename to trove/tests/unittests/guestagent/test_query.py index 71a8c38bd6..33cc894805 100644 --- a/reddwarf/tests/unittests/guestagent/test_query.py +++ b/trove/tests/unittests/guestagent/test_query.py @@ -13,7 +13,7 @@ # under the License import testtools -from reddwarf.guestagent import query +from trove.guestagent import query class QueryTest(testtools.TestCase): diff --git a/reddwarf/tests/unittests/guestagent/test_service.py b/trove/tests/unittests/guestagent/test_service.py similarity index 96% rename from reddwarf/tests/unittests/guestagent/test_service.py rename to trove/tests/unittests/guestagent/test_service.py index 4b3aa3ff19..4d46e1239b 100644 --- a/reddwarf/tests/unittests/guestagent/test_service.py +++ b/trove/tests/unittests/guestagent/test_service.py @@ -14,7 +14,7 @@ import testtools from mock import Mock, MagicMock -from reddwarf.guestagent import service +from trove.guestagent import service class ServiceTest(testtools.TestCase): diff --git a/reddwarf/tests/unittests/guestagent/test_volume.py b/trove/tests/unittests/guestagent/test_volume.py similarity index 98% rename from reddwarf/tests/unittests/guestagent/test_volume.py rename to trove/tests/unittests/guestagent/test_volume.py index 72f395a131..98da4d7ef1 100644 --- a/reddwarf/tests/unittests/guestagent/test_volume.py +++ b/trove/tests/unittests/guestagent/test_volume.py @@ -15,8 +15,8 @@ import os import testtools import pexpect from mock import Mock, MagicMock -from reddwarf.guestagent import volume -from reddwarf.common import utils +from trove.guestagent import volume +from trove.common import utils def _setUp_fake_spawn(return_val=0): diff --git a/reddwarf/tests/unittests/mgmt/__init__.py b/trove/tests/unittests/mgmt/__init__.py similarity index 100% rename from reddwarf/tests/unittests/mgmt/__init__.py rename to trove/tests/unittests/mgmt/__init__.py diff --git a/reddwarf/tests/unittests/mgmt/test_models.py b/trove/tests/unittests/mgmt/test_models.py similarity index 93% rename from reddwarf/tests/unittests/mgmt/test_models.py rename to trove/tests/unittests/mgmt/test_models.py index b04ac6e01c..f0238ad762 100644 --- a/reddwarf/tests/unittests/mgmt/test_models.py +++ b/trove/tests/unittests/mgmt/test_models.py @@ -20,27 +20,27 @@ from testtools.matchers import Equals, Is, Not from novaclient.v1_1 import Client from novaclient.v1_1.flavors import FlavorManager, Flavor from novaclient.v1_1.servers import Server, ServerManager -from reddwarf.backup.models import Backup +from trove.backup.models import Backup -from reddwarf.common.context import ReddwarfContext -from reddwarf.db.models import DatabaseModelBase -from reddwarf.extensions.mgmt.instances.models import NotificationTransformer -from reddwarf.extensions.mgmt.instances.models import \ +from trove.common.context import TroveContext +from trove.db.models import DatabaseModelBase +from trove.extensions.mgmt.instances.models import NotificationTransformer +from trove.extensions.mgmt.instances.models import \ NovaNotificationTransformer -from reddwarf.extensions.mgmt.instances.models import SimpleMgmtInstance -from reddwarf.instance.models import DBInstance -from reddwarf.instance.models import InstanceServiceStatus -from reddwarf.instance.models import ServiceStatuses -from reddwarf.instance.tasks import InstanceTasks -import reddwarf.extensions.mgmt.instances.models as mgmtmodels -from reddwarf.openstack.common.notifier import api as notifier -from reddwarf.common import remote +from trove.extensions.mgmt.instances.models import SimpleMgmtInstance +from trove.instance.models import DBInstance +from trove.instance.models import InstanceServiceStatus +from trove.instance.models import ServiceStatuses +from trove.instance.tasks import InstanceTasks +import trove.extensions.mgmt.instances.models as mgmtmodels +from trove.openstack.common.notifier import api as notifier +from trove.common import remote class MockMgmtInstanceTest(TestCase): def setUp(self): super(MockMgmtInstanceTest, self).setUp() - self.context = ReddwarfContext() + self.context = TroveContext() self.client = mock(Client) self.server_mgr = mock(ServerManager) self.client.servers = self.server_mgr @@ -279,7 +279,7 @@ class TestMgmtInstanceTasks(MockMgmtInstanceTest): when(self.flavor_mgr).get('flavor_1').thenReturn(flavor) when(notifier).notify(self.context, any(str), - 'reddwarf.instance.exists', + 'trove.instance.exists', 'INFO', any(dict)).thenReturn(None) # invocation @@ -288,6 +288,6 @@ class TestMgmtInstanceTasks(MockMgmtInstanceTest): # assertion verify(notifier, times=2).notify(self.context, any(str), - 'reddwarf.instance.exists', + 'trove.instance.exists', 'INFO', any(dict)) diff --git a/reddwarf/tests/unittests/quota/__init__.py b/trove/tests/unittests/quota/__init__.py similarity index 100% rename from reddwarf/tests/unittests/quota/__init__.py rename to trove/tests/unittests/quota/__init__.py diff --git a/reddwarf/tests/unittests/quota/test_quota.py b/trove/tests/unittests/quota/test_quota.py similarity index 97% rename from reddwarf/tests/unittests/quota/test_quota.py rename to trove/tests/unittests/quota/test_quota.py index 9893872717..16a25b6b94 100644 --- a/reddwarf/tests/unittests/quota/test_quota.py +++ b/trove/tests/unittests/quota/test_quota.py @@ -14,17 +14,17 @@ import testtools from mockito import mock, when, unstub, any, verify, never, times from mock import Mock -from reddwarf.quota.quota import DbQuotaDriver -from reddwarf.quota.models import Resource -from reddwarf.quota.models import Quota -from reddwarf.quota.models import QuotaUsage -from reddwarf.quota.models import Reservation -from reddwarf.db.models import DatabaseModelBase -from reddwarf.extensions.mgmt.quota.service import QuotaController -from reddwarf.common import exception -from reddwarf.common import cfg -from reddwarf.quota.quota import run_with_quotas -from reddwarf.quota.quota import QUOTAS +from trove.quota.quota import DbQuotaDriver +from trove.quota.models import Resource +from trove.quota.models import Quota +from trove.quota.models import QuotaUsage +from trove.quota.models import Reservation +from trove.db.models import DatabaseModelBase +from trove.extensions.mgmt.quota.service import QuotaController +from trove.common import exception +from trove.common import cfg +from trove.quota.quota import run_with_quotas +from trove.quota.quota import QUOTAS """ Unit tests for the classes and functions in DbQuotaDriver.py. """ @@ -123,7 +123,7 @@ class QuotaControllerTest(testtools.TestCase): self.assertEquals(200, result.status) self.assertEquals(2, result._data['quotas']['instances']) - @testtools.skipIf(not CONF.reddwarf_volume_support, + @testtools.skipIf(not CONF.trove_volume_support, 'Volume support is not enabled') def test_update_resource_volume(self): instance_quota = mock(Quota) diff --git a/reddwarf/tests/unittests/secgroups/__init__.py b/trove/tests/unittests/secgroups/__init__.py similarity index 100% rename from reddwarf/tests/unittests/secgroups/__init__.py rename to trove/tests/unittests/secgroups/__init__.py diff --git a/reddwarf/tests/unittests/secgroups/test_security_group.py b/trove/tests/unittests/secgroups/test_security_group.py similarity index 88% rename from reddwarf/tests/unittests/secgroups/test_security_group.py rename to trove/tests/unittests/secgroups/test_security_group.py index 42049e4d44..494661b343 100644 --- a/reddwarf/tests/unittests/secgroups/test_security_group.py +++ b/trove/tests/unittests/secgroups/test_security_group.py @@ -13,11 +13,11 @@ # under the License. import testtools -import reddwarf.common.remote +import trove.common.remote from mock import Mock -from reddwarf.extensions.security_group import models -from reddwarf.common import exception -from reddwarf.tests.fakes import nova +from trove.extensions.security_group import models +from trove.common import exception +from trove.tests.fakes import nova from novaclient import exceptions as nova_exceptions @@ -31,7 +31,7 @@ class Security_Group_Exceptions_Test(testtools.TestCase): def setUp(self): super(Security_Group_Exceptions_Test, self).setUp() - self.createNovaClient = reddwarf.common.remote.create_nova_client + self.createNovaClient = trove.common.remote.create_nova_client self.context = Mock() self.FakeClient = nova.fake_create_nova_client(self.context) @@ -44,12 +44,12 @@ class Security_Group_Exceptions_Test(testtools.TestCase): self.FakeClient.security_group_rules.create = fException self.FakeClient.security_group_rules.delete = fException - reddwarf.common.remote.create_nova_client = \ + trove.common.remote.create_nova_client = \ lambda c: self._return_mocked_nova_client(c) def tearDown(self): super(Security_Group_Exceptions_Test, self).tearDown() - reddwarf.common.remote.create_nova_client = self.createNovaClient + trove.common.remote.create_nova_client = self.createNovaClient def _return_mocked_nova_client(self, context): return self.FakeClient diff --git a/reddwarf/tests/unittests/taskmanager/__init__.py b/trove/tests/unittests/taskmanager/__init__.py similarity index 100% rename from reddwarf/tests/unittests/taskmanager/__init__.py rename to trove/tests/unittests/taskmanager/__init__.py diff --git a/reddwarf/tests/unittests/taskmanager/test_models.py b/trove/tests/unittests/taskmanager/test_models.py similarity index 96% rename from reddwarf/tests/unittests/taskmanager/test_models.py rename to trove/tests/unittests/taskmanager/test_models.py index 9ab98da8f7..750365e9da 100644 --- a/reddwarf/tests/unittests/taskmanager/test_models.py +++ b/trove/tests/unittests/taskmanager/test_models.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License -import reddwarf.common.remote as remote +import trove.common.remote as remote import testtools -import reddwarf.taskmanager.models as taskmanager_models -import reddwarf.backup.models as backup_models +import trove.taskmanager.models as taskmanager_models +import trove.backup.models as backup_models from mockito import mock, when, unstub, any, verify, never from swiftclient.client import ClientException diff --git a/reddwarf/tests/unittests/util/__init__.py b/trove/tests/unittests/util/__init__.py similarity index 100% rename from reddwarf/tests/unittests/util/__init__.py rename to trove/tests/unittests/util/__init__.py diff --git a/reddwarf/tests/unittests/util/matchers.py b/trove/tests/unittests/util/matchers.py similarity index 100% rename from reddwarf/tests/unittests/util/matchers.py rename to trove/tests/unittests/util/matchers.py diff --git a/reddwarf/tests/unittests/util/util.py b/trove/tests/unittests/util/util.py similarity index 85% rename from reddwarf/tests/unittests/util/util.py rename to trove/tests/unittests/util/util.py index 784d83c8da..2f9b68930b 100644 --- a/reddwarf/tests/unittests/util/util.py +++ b/trove/tests/unittests/util/util.py @@ -14,9 +14,9 @@ def init_db(): - from reddwarf.common import cfg - from reddwarf.db import get_db_api - from reddwarf.db.sqlalchemy import session + from trove.common import cfg + from trove.db import get_db_api + from trove.db.sqlalchemy import session CONF = cfg.CONF db_api = get_db_api() db_api.db_sync(CONF) diff --git a/reddwarf/tests/util/__init__.py b/trove/tests/util/__init__.py similarity index 85% rename from reddwarf/tests/util/__init__.py rename to trove/tests/util/__init__.py index e33bb1d438..fcb047db9a 100644 --- a/reddwarf/tests/util/__init__.py +++ b/trove/tests/util/__init__.py @@ -31,7 +31,7 @@ import subprocess import sys import time -from reddwarf.tests.config import CONFIG as test_config +from trove.tests.config import CONFIG as test_config from urllib import unquote @@ -44,7 +44,7 @@ except ImportError: from sqlalchemy import create_engine -from reddwarfclient import exceptions +from troveclient import exceptions from proboscis import test from proboscis.asserts import assert_false @@ -54,16 +54,16 @@ from proboscis.asserts import Check from proboscis.asserts import fail from proboscis.asserts import ASSERTION_ERROR from proboscis import SkipTest -from reddwarfclient import Dbaas -from reddwarfclient.client import ReddwarfHTTPClient -from reddwarf import tests -from reddwarfclient.xml import ReddwarfXmlClient -from reddwarf.tests.util import test_config as CONFIG -from reddwarf.tests.util.client import TestClient as TestClient -from reddwarf.tests.util.users import Requirements -from reddwarf.common.exception import PollTimeOut -from reddwarf.common.utils import import_object -from reddwarf.common.utils import import_class +from troveclient import Dbaas +from troveclient.client import TroveHTTPClient +from trove import tests +from troveclient.xml import TroveXmlClient +from trove.tests.util import test_config as CONFIG +from trove.tests.util.client import TestClient as TestClient +from trove.tests.util.users import Requirements +from trove.common.exception import PollTimeOut +from trove.common.utils import import_object +from trove.common.utils import import_class WHITE_BOX = test_config.white_box @@ -102,18 +102,18 @@ def create_dbaas_client(user): kwargs = { 'service_type': 'database', - 'insecure': test_config.values['reddwarf_client_insecure'], + 'insecure': test_config.values['trove_client_insecure'], } def set_optional(kwargs_name, test_conf_name): value = test_config.values.get(test_conf_name, None) if value is not None: kwargs[kwargs_name] = value - force_url = 'override_reddwarf_api_url' in test_config.values + force_url = 'override_trove_api_url' in test_config.values - service_url = test_config.get('override_reddwarf_api_url', None) + service_url = test_config.get('override_trove_api_url', None) if user.requirements.is_admin: - service_url = test_config.get('override_admin_reddwarf_api_url', + service_url = test_config.get('override_admin_trove_api_url', service_url) if service_url: kwargs['service_url'] = service_url @@ -124,13 +124,13 @@ def create_dbaas_client(user): test_config.auth_strategy) else: auth_strategy = test_config.auth_strategy - set_optional('region_name', 'reddwarf_client_region_name') - if test_config.values.get('override_reddwarf_api_url_append_tenant', + set_optional('region_name', 'trove_client_region_name') + if test_config.values.get('override_trove_api_url_append_tenant', False): kwargs['service_url'] += "/" + user.tenant if auth_strategy == 'fake': - from reddwarfclient import auth + from troveclient import auth class FakeAuth(auth.Authenticator): @@ -154,13 +154,13 @@ def create_dbaas_client(user): kwargs['auth_strategy'] = auth_strategy if not user.requirements.is_admin: - auth_url = test_config.reddwarf_auth_url + auth_url = test_config.trove_auth_url else: - auth_url = test_config.values.get('reddwarf_admin_auth_url', - test_config.reddwarf_auth_url) + auth_url = test_config.values.get('trove_admin_auth_url', + test_config.trove_auth_url) - if test_config.values.get('reddwarf_client_cls'): - cls_name = test_config.reddwarf_client_cls + if test_config.values.get('trove_client_cls'): + cls_name = test_config.trove_client_cls kwargs['client_cls'] = import_class(cls_name) dbaas = Dbaas(user.auth_user, user.auth_key, tenant=user.tenant, @@ -200,7 +200,7 @@ def process(cmd): def skip_if_xml(): - if "xml" in CONFIG.values.get('reddwarf_client_cls', ''): + if "xml" in CONFIG.values.get('trove_client_cls', ''): raise SkipTest("This feature does not work with XML.") @@ -255,7 +255,7 @@ if CONFIG.simulate_events: check_timeout() time.sleep(sleep_time) else: - from reddwarf.common.utils import poll_until + from trove.common.utils import poll_until def mysql_connection(): @@ -269,7 +269,7 @@ def mysql_connection(): class MySqlConnection(object): def assert_fails(self, user_name, password, ip): - from reddwarf.tests.util import mysql + from trove.tests.util import mysql try: with mysql.create_mysql_connection(ip, user_name, password) as db: pass @@ -282,7 +282,7 @@ class MySqlConnection(object): "%s" % mcf.message) def create(self, ip, user_name, password): - from reddwarf.tests.util import mysql + from trove.tests.util import mysql return mysql.create_mysql_connection(ip, user_name, password) diff --git a/reddwarf/tests/util/check.py b/trove/tests/util/check.py similarity index 100% rename from reddwarf/tests/util/check.py rename to trove/tests/util/check.py diff --git a/reddwarf/tests/util/client.py b/trove/tests/util/client.py similarity index 96% rename from reddwarf/tests/util/client.py rename to trove/tests/util/client.py index 0c73b32f73..7873dc120f 100644 --- a/reddwarf/tests/util/client.py +++ b/trove/tests/util/client.py @@ -28,9 +28,9 @@ from proboscis.asserts import * -from reddwarf.tests.config import CONFIG -from reddwarfclient.xml import ReddwarfXmlClient -from reddwarf.openstack.common import processutils +from trove.tests.config import CONFIG +from troveclient.xml import TroveXmlClient +from trove.openstack.common import processutils def add_report_event_to(home, name): @@ -135,7 +135,7 @@ def call_xmllint(name, body): fail("Error validating XML! %s" % pe) -class XmlLintClient(ReddwarfXmlClient): +class XmlLintClient(TroveXmlClient): content_type = 'xml' diff --git a/reddwarf/tests/util/mysql.py b/trove/tests/util/mysql.py similarity index 98% rename from reddwarf/tests/util/mysql.py rename to trove/tests/util/mysql.py index b6d6333912..46920e8984 100644 --- a/reddwarf/tests/util/mysql.py +++ b/trove/tests/util/mysql.py @@ -1,8 +1,8 @@ import pexpect import re from sqlalchemy import create_engine -from reddwarf import tests -from reddwarf.tests.config import CONFIG +from trove import tests +from trove.tests.config import CONFIG from sqlalchemy.exc import OperationalError try: from sqlalchemy.exc import ResourceClosedError diff --git a/reddwarf/tests/util/server_connection.py b/trove/tests/util/server_connection.py similarity index 93% rename from reddwarf/tests/util/server_connection.py rename to trove/tests/util/server_connection.py index 1496b0a6ee..25f20ad557 100644 --- a/reddwarf/tests/util/server_connection.py +++ b/trove/tests/util/server_connection.py @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. -from reddwarf import tests -from reddwarf.tests.config import CONFIG -from reddwarf.tests import util -from reddwarf.tests.util.users import Requirements +from trove import tests +from trove.tests.config import CONFIG +from trove.tests import util +from trove.tests.util.users import Requirements def create_server_connection(instance_id): diff --git a/reddwarf/tests/util/usage.py b/trove/tests/util/usage.py similarity index 97% rename from reddwarf/tests/util/usage.py rename to trove/tests/util/usage.py index e61aef1e46..b18a949039 100644 --- a/reddwarf/tests/util/usage.py +++ b/trove/tests/util/usage.py @@ -21,8 +21,8 @@ from proboscis.asserts import assert_equal from proboscis.asserts import assert_not_equal import unittest -from reddwarf.common import utils -from reddwarf.tests.config import CONFIG +from trove.common import utils +from trove.tests.config import CONFIG from proboscis.dependencies import SkipTest MESSAGE_QUEUE = defaultdict(list) diff --git a/reddwarf/tests/util/users.py b/trove/tests/util/users.py similarity index 99% rename from reddwarf/tests/util/users.py rename to trove/tests/util/users.py index 87ec02f171..5efaecc476 100644 --- a/reddwarf/tests/util/users.py +++ b/trove/tests/util/users.py @@ -26,7 +26,7 @@ class Requirements(object): def __init__(self, is_admin=None, services=None): self.is_admin = is_admin - self.services = services or ["reddwarf"] + self.services = services or ["trove"] # Make sure they're all the same kind of string. self.services = [str(service) for service in self.services] diff --git a/reddwarf/version.py b/trove/version.py similarity index 96% rename from reddwarf/version.py rename to trove/version.py index 04081a1b3a..aac93d2ffc 100644 --- a/reddwarf/version.py +++ b/trove/version.py @@ -16,7 +16,7 @@ # under the License. try: - from reddwarf.vcsversion import version_info + from trove.vcsversion import version_info except ImportError: version_info = {'branch_nick': u'LOCALBRANCH', 'revision_id': 'LOCALREVISION', diff --git a/reddwarf/versions.py b/trove/versions.py similarity index 99% rename from reddwarf/versions.py rename to trove/versions.py index 97c2318907..01779eecdc 100644 --- a/reddwarf/versions.py +++ b/trove/versions.py @@ -19,7 +19,7 @@ import os import routes from xml.dom import minidom -from reddwarf.common import wsgi +from trove.common import wsgi VERSIONS = {