summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Riedemann <mriedem.os@gmail.com>2017-08-02 11:46:16 -0400
committerMatt Riedemann <mriedem.os@gmail.com>2017-08-02 14:02:07 -0400
commit0fb67d459baa0fb22391b1b1da3dba5349666bb7 (patch)
tree38e6d3da34c2443eb1f3dc9f6d2adbe7dde665c8
parentfa171bd3e92d7d7b9032fc035f554dcb4621ce94 (diff)
Fix AttributeError in api example snippets tests8.0.0.0rc18.0.0
Change I3f020b6bcb1b9bf6d18a3b4f738c13cccd1bbff8 in python-troveclient 2.11.0 changed the troveclient.compat.client._logger variable to be a LOG variable. I have no idea how this hasn't been breaking the Trove API examples CI job since python-troveclient 2.11.0 was released. Maybe it has an no one has noticed or cared to fix it. Anyway, this adds hasattr checking in the test code to set the log level on the correct variable based on which version of troveclient is being used. Also - no idea why setting the log level in the client for these API tests is even necessary, but this dates back to a change in 2014 so who knows. Not me. -- This also fixes bug 1708171 by making nova run in singleconductor mode so the affinity/anti-affinity scheduling tests work. Trove CI is blocked by both changes so they have to go together. Change-Id: Iaf00fc55336a8049c8303b8fa2849df2366115e6 Closes-Bug: #1708190 Closes-Bug: #1708171
Notes
Notes (review): Code-Review+2: Amrith Kumar <amrith.kumar@gmail.com> Workflow+1: Amrith Kumar <amrith.kumar@gmail.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 03 Aug 2017 04:50:15 +0000 Reviewed-on: https://review.openstack.org/490061 Project: openstack/trove Branch: refs/heads/master
-rw-r--r--devstack/settings5
-rw-r--r--trove/tests/examples/snippets.py6
2 files changed, 10 insertions, 1 deletions
diff --git a/devstack/settings b/devstack/settings
index 2dff5fb..02632a6 100644
--- a/devstack/settings
+++ b/devstack/settings
@@ -71,3 +71,8 @@ TROVE_DEVSTACK_FILES=${TROVE_DEVSTACK_DIR}/files
71TROVE_WSGI_DIR=${TROVE_WSGI_DIR:-/var/www/trove} 71TROVE_WSGI_DIR=${TROVE_WSGI_DIR:-/var/www/trove}
72 72
73enable_service trove tr-api tr-tmgr tr-cond 73enable_service trove tr-api tr-tmgr tr-cond
74
75# Trove CI tests server group anti-affinity policies and therefore needs
76# Nova to use a single MQ for the computes to talk to the scheduler.
77CELLSV2_SETUP=singleconductor
78
diff --git a/trove/tests/examples/snippets.py b/trove/tests/examples/snippets.py
index 65d9019..06c7601 100644
--- a/trove/tests/examples/snippets.py
+++ b/trove/tests/examples/snippets.py
@@ -33,7 +33,11 @@ from trove.tests.config import CONFIG
33from trove.tests.examples.client import JsonClient 33from trove.tests.examples.client import JsonClient
34from trove.tests.examples.client import SnippetWriter 34from trove.tests.examples.client import SnippetWriter
35 35
36trove_client._logger.setLevel(logging.CRITICAL) 36# troveclient.compat.client._logger was changed to LOG in 2.11.0
37if hasattr(trove_client, '_logger'):
38 trove_client._logger.setLevel(logging.CRITICAL)
39elif hasattr(trove_client, 'LOG'):
40 trove_client.LOG.setLevel(logging.CRITICAL)
37 41
38FAKE_INFO = {'m': 30, 's': 0, 'uuid': 'abcdef00-aaaa-aaaa-aaaa-bbbbbbbbbbbb'} 42FAKE_INFO = {'m': 30, 's': 0, 'uuid': 'abcdef00-aaaa-aaaa-aaaa-bbbbbbbbbbbb'}
39EXAMPLE_BACKUP_ID = "a9832168-7541-4536-b8d9-a8a9b79cf1b4" 43EXAMPLE_BACKUP_ID = "a9832168-7541-4536-b8d9-a8a9b79cf1b4"