From 7e77bf34f2fdc43c935380064eb0d7045988eec0 Mon Sep 17 00:00:00 2001 From: Kazuhiro MIYAHARA Date: Tue, 20 Mar 2018 04:45:04 +0000 Subject: [PATCH] Refactor tempurl functional test's try-finally This is a following patch of [1]. In [1] comment, tim suggested implementation for same behavior with less code. This change implemented the suggestion. See [1] for more details. [1]: https://review.openstack.org/#/c/547306/ Change-Id: Ifd8a0534fbdf41837977028c0c6ef99f1f6ac0f0 --- test/functional/test_tempurl.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/test/functional/test_tempurl.py b/test/functional/test_tempurl.py index 2e4be9021a..67a2c840c6 100644 --- a/test/functional/test_tempurl.py +++ b/test/functional/test_tempurl.py @@ -587,13 +587,8 @@ class TestContainerTempurl(Base): def test_tempurl_keys_hidden_from_acl_readonly(self): if not tf.cluster_info.get('tempauth'): raise SkipTest('TEMP AUTH SPECIFIC TEST') - original_token = self.env.container.conn.storage_token - try: - self.env.container.conn.storage_token = \ - self.env.conn2.storage_token - metadata = self.env.container.info() - finally: - self.env.container.conn.storage_token = original_token + metadata = self.env.container.info(cfg={ + 'use_token': self.env.conn2.storage_token}) self.assertNotIn( 'tempurl_key', metadata,