From 8a823dc5ddc376f80104861dbd3961bb50d9f1a5 Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Thu, 3 May 2018 06:11:50 +0200 Subject: [PATCH] Don't create db accounts unencrypted Recent postgres versions removed the support to store unencrypted passwords so just remove that. Otherwise db tests fail with newer postgres versions [1]. [1] Trace: Traceback (most recent call last): File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/tests/base.py", line 2156, in setUp self.setup_config() File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/tests/base.py", line 3230, in setup_config self.useFixture(f) File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 756, in useFixture reraise(*exc_info) File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/.tox/py36/lib/python3.6/site-packages/testtools/_compat3x.py", line 16, in reraise raise exc_obj.with_traceback(exc_tb) File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/.tox/py36/lib/python3.6/site-packages/testtools/testcase.py", line 731, in useFixture fixture.setUp() File "/home/zuul/src/git.openstack.org/openstack-infra/zuul/tests/base.py", line 1947, in setUp self.name, self.passwd)) psycopg2.NotSupportedError: UNENCRYPTED PASSWORD is no longer supported LINE 1: create role efopzqqg_6361 with login unencrypted password 'c... ^ HINT: Remove UNENCRYPTED to store the password in encrypted form instead. Change-Id: Ic305708161f9160844a0360025c9a9f70e229257 --- tests/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/base.py b/tests/base.py index 1f8523f1c4..9ba167d9e5 100755 --- a/tests/base.py +++ b/tests/base.py @@ -1943,7 +1943,7 @@ class PostgresqlSchemaFixture(fixtures.Fixture): database="openstack_citest") db.autocommit = True cur = db.cursor() - cur.execute("create role %s with login unencrypted password '%s';" % ( + cur.execute("create role %s with login password '%s';" % ( self.name, self.passwd)) cur.execute("create database %s OWNER %s TEMPLATE template0 " "ENCODING 'UTF8';" % (self.name, self.name))