summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devstack/plugin.sh4
-rw-r--r--doc/source/admin/building_guest_images.rst7
-rw-r--r--releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po285
-rw-r--r--trove/instance/models.py15
-rwxr-xr-xtrove/taskmanager/models.py2
-rw-r--r--trove/tests/fakes/dns.py7
-rw-r--r--trove/tests/fakes/nova.py8
-rw-r--r--trove/tests/unittests/cluster/test_cluster_views.py8
-rw-r--r--trove/tests/unittests/instance/test_instance_models.py26
-rw-r--r--trove/tests/unittests/instance/test_instance_views.py28
10 files changed, 348 insertions, 42 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 01800907..2b34158e 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -538,7 +538,9 @@ function config_trove_network {
if [[ "$shared" == "False" ]]; then
openstack network set ${PRIVATE_NETWORK_NAME} --share
fi
- sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP
+ if [[ -n ${ROUTER_GW_IP} && -n ${IPV4_ADDRS_SAFE_TO_USE} ]]; then
+ sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP
+ fi
# Make sure we can reach the management port of the service VM, this
# configuration is only for testing purpose. In production, it's
diff --git a/doc/source/admin/building_guest_images.rst b/doc/source/admin/building_guest_images.rst
index ce56520a..8192b679 100644
--- a/doc/source/admin/building_guest_images.rst
+++ b/doc/source/admin/building_guest_images.rst
@@ -30,6 +30,13 @@ stored in Glance. This document shows you the steps to build the guest images.
is created and registered in Glance automatically, unless it's disabled by
setting ``TROVE_ENABLE_IMAGE_BUILD=false`` in devstack local.conf file.
+ Since Yoga release, Trove sets default use_nova_server_config_drive to
+ ``False``. This change will break instance provisioning in some cases.
+ To avoid that, make sure your ``DIB_CLOUD_INIT_DATASOURCES`` environment
+ contains ``OpenStack`` to configure cloud-init to use metadata serivce.
+ If cloud-init still doesn't inject files after changing the environment,
+ please ask your IaaS provider admin to enable OpenStack metadata service.
+
High Level Overview of a Trove Guest Instance
=============================================
diff --git a/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po b/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po
index 9d97a7d9..fec41f00 100644
--- a/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po
+++ b/releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po
@@ -1,13 +1,14 @@
# Andi Chandler <andi@gowling.com>, 2020. #zanata
+# Andi Chandler <andi@gowling.com>, 2022. #zanata
msgid ""
msgstr ""
"Project-Id-Version: trove\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2021-03-22 23:03+0000\n"
+"POT-Creation-Date: 2022-07-04 11:47+0000\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"PO-Revision-Date: 2020-11-03 11:50+0000\n"
+"PO-Revision-Date: 2022-07-05 09:30+0000\n"
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
"Language-Team: English (United Kingdom)\n"
"Language: en_GB\n"
@@ -29,6 +30,18 @@ msgstr "13.0.0"
msgid "14.0.0"
msgstr "14.0.0"
+msgid "14.1.0"
+msgstr "14.1.0"
+
+msgid "15.0.0"
+msgstr "15.0.0"
+
+msgid "15.0.0-13"
+msgstr "15.0.0-13"
+
+msgid "16.0.0"
+msgstr "16.0.0"
+
msgid "5.0.0"
msgstr "5.0.0"
@@ -222,12 +235,48 @@ msgstr ""
"into Trove guest agent image at build time."
msgid ""
+"Added a new field ``operating_status`` for the instance to show the actual "
+"operational status of user's database. See https://docs.openstack.org/trove/"
+"latest/user/instance-status.html for more information."
+msgstr ""
+"Added a new field ``operating_status`` for the instance to show the actual "
+"operational status of the user's database. See https://docs.openstack.org/"
+"trove/latest/user/instance-status.html for more information."
+
+msgid ""
"Added a new field named ``addresses`` in the instance API response which "
"including the IP address and type, either 'private' or 'public'."
msgstr ""
"Added a new field named ``addresses`` in the instance API response which "
"including the IP address and type, either 'private' or 'public'."
+msgid ""
+"Added a periodic task for postgresql datastore to clean up the archived WAL "
+"files. Added a check when creating incremental backups for postgresql. A new "
+"container image ``openstacktrove/db-backup-postgresql:1.1.2`` is uploaded to "
+"docker hub."
+msgstr ""
+"Added a periodic task for the PostgreSQL datastore to clean up the archived "
+"WAL files. Added a check when creating incremental backups for PostgreSQL. A "
+"new container image ``openstacktrove/db-backup-postgresql:1.1.2`` is "
+"uploaded to docker hub."
+
+msgid ""
+"Added custom container registry configuration for trove guest agent, it's "
+"now possible to use images in private registry rather than docker hub."
+msgstr ""
+"Added custom container registry configuration for Trove guest agent, it's "
+"now possible to use images in the private registry rather than Docker hub."
+
+msgid ""
+"Added iptables-persistent package in the guest image element for diskimage-"
+"builder. The Trove service administrator is able to perform iptables command "
+"(leveraging cloud-init config) and persist the change."
+msgstr ""
+"Added iptables-persistent package in the guest image element for diskimage-"
+"builder. The Trove service administrator is able to perform iptables command "
+"(leveraging cloud-init config) and persist the change."
+
msgid "Added new tool ``trove-status upgrade check``."
msgstr "Added new tool ``trove-status upgrade check``."
@@ -260,6 +309,24 @@ msgstr ""
"with a volume type that is not on the approved list for the specified "
"datastore version they will receive an error."
+msgid ""
+"Added the ability to create the cinder volume in the same AZ as the nova "
+"instance. Set ``enable_volume_az`` to True (defaults to False)"
+msgstr ""
+"Added the ability to create the Cinder volume in the same AZ as the Nova "
+"instance. Set ``enable_volume_az`` to True (defaults to False)"
+
+msgid ""
+"Added the ability to quota on total amount of RAM in MB used per project. "
+"Set ``quota.max_ram_per_tenant`` to enable. Default is -1 (unlimited) to be "
+"backwards compatible. Existing installations will need to manually backfill "
+"quote usage for this to work as expected."
+msgstr ""
+"Added the ability to quota on the total amount of RAM in MB used per "
+"project. Set ``quota.max_ram_per_tenant`` to enable. Default is -1 "
+"(unlimited) to be backwards compatible. Existing installations will need to "
+"manually backfill quote usage for this to work as expected."
+
msgid "Adding the ability to root enable a pxc cluster."
msgstr "Adding the ability to root enable a pxc cluster."
@@ -311,6 +378,13 @@ msgid "An invalid module driver is now logged correctly. Bug 1579900"
msgstr "An invalid module driver is now logged correctly. Bug 1579900"
msgid ""
+"Any 3rd party clients that are talking with Trove API to wait for ``status`` "
+"should be notified to use ``operating_status`` instead."
+msgstr ""
+"Any 3rd party clients that are talking with Trove API to wait for ``status`` "
+"should be notified to use ``operating_status`` instead."
+
+msgid ""
"Any existing scripts that rely on the database instance ``ACTIVE`` status "
"should now rely on ``HEALTHY`` status."
msgstr ""
@@ -349,15 +423,171 @@ msgstr ""
"fixed. This issue would have potentially made it impossible to delete a "
"module. Bug 1640010"
+msgid ""
+"Changed the network mode of database container to \"bridge\" and exposed the "
+"service ports. Cloud operator could adjust the iptables to restrict network "
+"access from the database container to the outside. An example::"
+msgstr ""
+"Changed the network mode of the database container to \"bridge\" and exposed "
+"the service ports. Cloud operator could adjust the iptables to restrict "
+"network access from the database container to the outside. An example::"
+
+msgid "Close the race condition window in user-list call. Closes-Bug 1617464"
+msgstr "Close the race condition window in user-list call. Closes-Bug 1617464"
+
+msgid ""
+"Cloud administrator needs to create a Nova keypair and specify the keypair "
+"name for config option ``nova_keypair``, the private key is used to ssh into "
+"new database instances created. The previous private key is also needed to "
+"ssh into the existing database instances."
+msgstr ""
+"Cloud administrator needs to create a Nova keypair and specify the keypair "
+"name for config option ``nova_keypair``, the private key is used to ssh into "
+"new database instances created. The previous private key is also needed to "
+"ssh into the existing database instances."
+
+msgid "Configuration show masks any password values."
+msgstr "Configuration show masks any password values."
+
msgid "Current Series Release Notes"
msgstr "Current Series Release Notes"
+msgid ""
+"Database service (mysql and mariadb) is now running as docker container "
+"inside the trove instance. The image is defined by ``docker_image`` config "
+"option for each datastore."
+msgstr ""
+"Database service (MySQL and MariaDB) is now running as a Docker container "
+"inside the trove instance. The image is defined by ``docker_image`` config "
+"option for each datastore."
+
msgid "Deprecation Notes"
msgstr "Deprecation Notes"
+msgid ""
+"Do not remove MySQL root user on root-disable so that the proper status can "
+"be reported on restore. Bug 1549600"
+msgstr ""
+"Do not remove MySQL root user on root-disable so that the proper status can "
+"be reported on restore. Bug 1549600"
+
+msgid "Dropping support for python 2.6"
+msgstr "Dropping support for Python 2.6"
+
+msgid "Enable database log retrieval on Cassandra instances."
+msgstr "Enable database log retrieval on Cassandra instances."
+
+msgid ""
+"Errors that occur in Trove are now persisted in the database and are "
+"returned in the standard 'show' command."
+msgstr ""
+"Errors that occur in Trove are now persisted in the database and are "
+"returned in the standard 'show' command."
+
+msgid ""
+"Existing database services are not affected. However, in order for Trove to "
+"communicate with trove guest agent, new guest image needs to be built and "
+"existing trove instances need to be backed up and restored."
+msgstr ""
+"Existing database services are not affected. However, in order for Trove to "
+"communicate with Trove guest agent, a new guest image needs to be built and "
+"existing trove instances need to be backed up and restored."
+
+msgid ""
+"Filter ignored users in the original query before the result gets paginated "
+"(like in list_databases)."
+msgstr ""
+"Filter ignored users in the original query before the result gets paginated "
+"(like in list_databases)."
+
+msgid ""
+"Fix IniCodec to deserialize Python objects. This also brings it in line with "
+"other codecs. guestagent_utils.to_bytes return the byte values as ints. See "
+"bug 1599656"
+msgstr ""
+"Fix IniCodec to deserialize Python objects. This also brings it in line with "
+"other codecs. guestagent_utils.to_bytes return the byte values as ints. See "
+"bug 1599656"
+
+msgid "Fix Postgresql promote (bug 1633515)."
+msgstr "Fix Postgresql promote (bug 1633515)."
+
+msgid ""
+"Fix bug 1537986 which corrects the pagination in the mysql user list "
+"command. When internal users (ignore_users) are eliminated from the list, "
+"the pagination was not correctly handled."
+msgstr ""
+"Fix bug 1537986 which corrects the pagination in the MySQL user list "
+"command. When internal users (ignore_users) are eliminated from the list, "
+"the pagination was not correctly handled."
+
+msgid ""
+"Fix race condition in cluster-show that returned erroneous not found error. "
+"Bug 1643002"
+msgstr ""
+"Fix race condition in cluster-show that returned erroneous not found error. "
+"Bug 1643002"
+
+msgid ""
+"Fixed a race condition that instance becomes ERROR when Trove is handling "
+"creating and deleting at the same time."
+msgstr ""
+"Fixed a race condition that instance becomes ERROR when Trove is handling "
+"creating and deleting at the same time."
+
+msgid ""
+"Fixed an issue that orphan volumes left after removing instances, especially "
+"for the case that instance creation failed because of timeout when waiting "
+"for the volume available."
+msgstr ""
+"Fixed an issue that orphan volumes left after removing instances, especially "
+"for the case that instance creation failed because of timeout when waiting "
+"for the volume available."
+
+msgid ""
+"Fixed an issue that the replication configuration is lost after resizing "
+"instance."
+msgstr ""
+"Fixed an issue that the replication configuration is lost after resizing the "
+"instance."
+
+msgid ""
+"Fixed backup creation failed issue when using custom container image "
+"registry."
+msgstr ""
+"Fixed backup creation failed issue when using custom container image "
+"registry."
+
+msgid ""
+"Fixed default configuration template for MySQL to ensure that replication "
+"uses binlog_format. Bug 1563541."
+msgstr ""
+"Fixed default configuration template for MySQL to ensure that replication "
+"uses binlog_format. Bug 1563541."
+
+msgid ""
+"Fixed issue where module-apply after module-remove caused module-query to "
+"skip reporting on that module. Bug 1571799"
+msgstr ""
+"Fixed issue where module-apply after module-remove caused module-query to "
+"skip reporting on that module. Bug 1571799"
+
+msgid ""
+"Fixed parsing of GTID references containing a list of GTIDs from "
+"xtrabackup_binlog_info file on MySql replicas."
+msgstr ""
+"Fixed parsing of GTID references containing a list of GTIDs from "
+"xtrabackup_binlog_info file on MySQL replicas."
+
+msgid "Mitaka Series Release Notes"
+msgstr "Mitaka Series Release Notes"
+
msgid "Newton Series Release Notes"
msgstr "Newton Series Release Notes"
+msgid "Ocata Series Release Notes"
+msgstr "Ocata Series Release Notes"
+
msgid "Pike Series Release Notes"
msgstr "Pike Series Release Notes"
@@ -370,9 +600,51 @@ msgstr "Rocky Series Release Notes"
msgid "Stein Series Release Notes"
msgstr "Stein Series Release Notes"
+msgid ""
+"The cloud admin is able to apply a security group to management port(with "
+"purpose of communicating with control plane and other management tasks) of "
+"the Trove instance, by setting the ``management_security_groups`` config "
+"option. The cloud admin is responsible for managing the security group "
+"rules. The security group and its rules need to be created before deploying "
+"Trove."
+msgstr ""
+"The cloud admin is able to apply a security group to the management "
+"port(with the purpose of communicating with the control plane and other "
+"management tasks) of the Trove instance, by setting the "
+"``management_security_groups`` config option. The cloud admin is responsible "
+"for managing the security group rules. The security group and its rules need "
+"to be created before deploying Trove."
+
+msgid ""
+"The config option ``default_neutron_networks`` is deprecated and will be "
+"removed in the future release, use ``management_networks`` instead."
+msgstr ""
+"The config option ``default_neutron_networks`` is deprecated and will be "
+"removed in the future release, use ``management_networks`` instead."
+
+msgid ""
+"The database backup and restore operations are performed by docker container "
+"inside the trove instance."
+msgstr ""
+"The database backup and restore operations are performed by the Docker "
+"container inside the Trove instance."
+
+msgid "The project user can query the project's own resource quota."
+msgstr "The project user can query the project's own resource quota."
+
+msgid ""
+"The reset-status command will set the task and status of an instance to "
+"ERROR after which it can be deleted."
+msgstr ""
+"The reset-status command will set the task and status of an instance to "
+"ERROR after which it can be deleted."
+
msgid "Train Series Release Notes"
msgstr "Train Series Release Notes"
+msgid "Trove Release Notes"
+msgstr "Trove Release Notes"
+
msgid ""
"Trove is now using admin clients by default to communicate with Nova, "
"Cinder, Neutron and Glance. Deployers want to stick to the old clients need "
@@ -458,6 +730,9 @@ msgstr ""
msgid "Victoria Series Release Notes"
msgstr "Victoria Series Release Notes"
+msgid "Wallaby Series Release Notes"
+msgstr "Wallaby Series Release Notes"
+
msgid ""
"When resizing volume for an instance which is the primary of a replication "
"cluster, Trove also resizes the volume for all the replicas automatically."
@@ -472,6 +747,12 @@ msgstr ""
"When the trove-guestagent failed to update the datastore service status, the "
"instance status should be ERROR."
+msgid "Xena Series Release Notes"
+msgstr "Xena Series Release Notes"
+
+msgid "Yoga Series Release Notes"
+msgstr "Yoga Series Release Notes"
+
msgid ""
"[`bug 1776229 <https://bugs.launchpad.net/trove/+bug/1776229>`_] "
"endpoint_type is now working with single tenant which gives the possibility "
diff --git a/trove/instance/models.py b/trove/instance/models.py
index 2b17cc73..8469f174 100644
--- a/trove/instance/models.py
+++ b/trove/instance/models.py
@@ -266,14 +266,13 @@ class SimpleInstance(object):
return None
IPs = []
- for address_list in self.addresses.values():
- for addr_info in address_list:
- if CONF.ip_regex and CONF.black_list_regex:
- if not ip_visible(addr_info['addr'], CONF.ip_regex,
- CONF.black_list_regex):
- continue
-
- IPs.append(addr_info['addr'])
+ for address in self.addresses:
+ if CONF.ip_regex and CONF.black_list_regex:
+ if not ip_visible(address['address'], CONF.ip_regex,
+ CONF.black_list_regex):
+ continue
+
+ IPs.append(address)
return IPs
diff --git a/trove/taskmanager/models.py b/trove/taskmanager/models.py
index 134aecb5..58dd8f2b 100755
--- a/trove/taskmanager/models.py
+++ b/trove/taskmanager/models.py
@@ -988,7 +988,7 @@ class FreshInstanceTasks(FreshInstance, NotifyMixin, ConfigurationMixin):
# Use config_drive instead by userdata
# We will inject guest config by cloud-config
- if not config_drive:
+ if files:
if not userdata:
userdata = self.prepare_cloud_config(files)
else:
diff --git a/trove/tests/fakes/dns.py b/trove/tests/fakes/dns.py
index d65bbbd8..865ed176 100644
--- a/trove/tests/fakes/dns.py
+++ b/trove/tests/fakes/dns.py
@@ -78,9 +78,8 @@ class FakeDnsChecker(object):
# the ability to return the IP from the API as well as a hostname,
# since that lines up to the DnsEntry's content field.
ip_addresses = mgmt_instance.server['addresses']
- for network_name, ip_list in ip_addresses.items():
- for ip in ip_list:
- if entry.content == ip['addr']:
- return
+ for address in ip_addresses:
+ if entry.content == address['address']:
+ return
fail("Couldn't find IP address %s among these values: %s"
% (entry.content, ip_addresses))
diff --git a/trove/tests/fakes/nova.py b/trove/tests/fakes/nova.py
index a0779147..88df4d89 100644
--- a/trove/tests/fakes/nova.py
+++ b/trove/tests/fakes/nova.py
@@ -17,6 +17,7 @@ import collections
import uuid
import eventlet
+
from novaclient import exceptions as nova_exceptions
from oslo_log import log as logging
@@ -128,7 +129,10 @@ class FakeServer(object):
@property
def addresses(self):
- return {"private": [{"addr": "123.123.123.123"}]}
+ return [{
+ "address": "123.123.123.123",
+ 'type': 'private',
+ 'network': 'net-id'}]
def confirm_resize(self):
if self.status != "VERIFY_RESIZE":
@@ -576,7 +580,7 @@ class FakeHost(object):
'status': server.status
})
if (str(server.flavor_ref).startswith('http:') or
- str(server.flavor_ref).startswith('https:')):
+ str(server.flavor_ref).startswith('https:')):
flavor = FLAVORS.get_by_href(server.flavor_ref)
else:
flavor = FLAVORS.get(server.flavor_ref)
diff --git a/trove/tests/unittests/cluster/test_cluster_views.py b/trove/tests/unittests/cluster/test_cluster_views.py
index 9833da96..19fbbc43 100644
--- a/trove/tests/unittests/cluster/test_cluster_views.py
+++ b/trove/tests/unittests/cluster/test_cluster_views.py
@@ -83,15 +83,15 @@ class ClusterViewTest(trove_testtools.TestCase):
cluster.instances.append(Mock())
cluster.instances[0].type = 'configsvr'
cluster.instances[0].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[0].datastore_version.manager = 'mongodb'
cluster.instances[1].type = 'query_router'
cluster.instances[1].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[1].datastore_version.manager = 'mongodb'
cluster.instances[2].type = 'member'
cluster.instances[2].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[2].datastore_version.manager = 'mongodb'
def test_case(ip_to_be_published_for,
@@ -128,7 +128,7 @@ class ClusterInstanceDetailViewTest(trove_testtools.TestCase):
self.instance.volume_used = '3'
self.instance.root_password = 'iloveyou'
self.instance.get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
self.instance.slave_of_id = None
self.instance.slaves = None
self.context = trove_testtools.TroveTestContext(self)
diff --git a/trove/tests/unittests/instance/test_instance_models.py b/trove/tests/unittests/instance/test_instance_models.py
index 96ab8726..6283a12c 100644
--- a/trove/tests/unittests/instance/test_instance_models.py
+++ b/trove/tests/unittests/instance/test_instance_models.py
@@ -11,9 +11,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+import uuid
+
from unittest.mock import Mock
from unittest.mock import patch
-import uuid
from trove.backup import models as backup_models
from trove.common import cfg
@@ -25,9 +26,9 @@ from trove.instance import models
from trove.instance.models import DBInstance
from trove.instance.models import DBInstanceFault
from trove.instance.models import Instance
-from trove.instance.models import instance_encryption_key_cache
from trove.instance.models import InstanceServiceStatus
from trove.instance.models import SimpleInstance
+from trove.instance.models import instance_encryption_key_cache
from trove.instance.service_status import ServiceStatuses
from trove.instance.tasks import InstanceTasks
from trove.taskmanager import api as task_api
@@ -50,12 +51,17 @@ class SimpleInstanceTest(trove_testtools.TestCase):
ServiceStatuses.BUILDING), ds_version=Mock(), ds=Mock(),
locality='affinity')
self.instance.context = self.context
- db_info.addresses = {
- 'private': [
- {'version': 4, 'addr': '123.123.123.123'},
- {'version': 4, 'addr': '10.123.123.123'}],
- 'public': [
- {'version': 4, 'addr': '15.123.123.123'}]}
+ db_info.addresses = [{
+ 'type': 'private',
+ 'address': '123.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'private',
+ 'address': '10.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'public',
+ 'address': '15.123.123.123',
+ 'network': 'net-id-public'}]
+
self.orig_ip_regex = CONF.ip_regex
self.orig_black_list_regex = CONF.black_list_regex
@@ -78,8 +84,8 @@ class SimpleInstanceTest(trove_testtools.TestCase):
CONF.black_list_regex = '^10.123.123.*'
ip = self.instance.get_visible_ip_addresses()
self.assertEqual(2, len(ip))
- self.assertIn('123.123.123.123', ip)
- self.assertIn('15.123.123.123', ip)
+ self.assertIn('123.123.123.123', ip[0].get('address'))
+ self.assertIn('15.123.123.123', ip[1].get('address'))
def test_filter_ips_black_list(self):
CONF.ip_regex = '.*'
diff --git a/trove/tests/unittests/instance/test_instance_views.py b/trove/tests/unittests/instance/test_instance_views.py
index a05affd5..d47adbe3 100644
--- a/trove/tests/unittests/instance/test_instance_views.py
+++ b/trove/tests/unittests/instance/test_instance_views.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
-from unittest.mock import MagicMock
-from unittest.mock import Mock
from trove.common import cfg
from trove.instance.views import InstanceDetailView
from trove.instance.views import InstanceView
from trove.tests.unittests import trove_testtools
+from unittest.mock import MagicMock
+from unittest.mock import Mock
CONF = cfg.CONF
@@ -27,9 +27,16 @@ class InstanceViewsTest(trove_testtools.TestCase):
def setUp(self):
super(InstanceViewsTest, self).setUp()
- self.addresses = {"private": [{"addr": "123.123.123.123"}],
- "internal": [{"addr": "10.123.123.123"}],
- "public": [{"addr": "15.123.123.123"}]}
+ self.addresses = [{
+ 'type': 'private',
+ 'address': '123.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'private',
+ 'address': '10.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'public',
+ 'address': '15.123.123.123',
+ 'network': 'net-id-public'}]
self.orig_ip_regex = CONF.ip_regex
def tearDown(self):
@@ -53,11 +60,12 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
self.instance.datastore_version.manager = 'mysql'
self.instance.hostname = 'test.trove.com'
self.ip = "1.2.3.4"
- self.instance.addresses = {"private": [{"addr": self.ip}]}
+ self.instance.addresses = [
+ {"address": self.ip, 'type': 'private', 'network': 'net-id'}]
self.instance.volume_used = '3'
self.instance.root_password = 'iloveyou'
self.instance.get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
self.instance.slave_of_id = None
self.instance.slaves = []
self.instance.locality = 'affinity'
@@ -139,7 +147,7 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
instance = MagicMock()
instance.hostname = None
instance.get_visible_ip_addresses.return_value = [
- {'address': '10.111.0.27', 'type': 'private'}
+ {'address': '10.111.0.27', 'type': 'private', 'network': 'net-id'}
]
instance.access = None
instance.slaves = []
@@ -150,8 +158,8 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
self.assertFalse(data['access']['is_public'])
instance.get_visible_ip_addresses.return_value = [
- {'address': '10.111.0.27', 'type': 'private'},
- {'address': '172.30.5.107', 'type': 'public'}
+ {'address': '10.111.0.27', 'type': 'private', 'network': 'net-id'},
+ {'address': '172.30.5.107', 'type': 'public', 'network': 'net-id'}
]
view = InstanceDetailView(instance, self.req)