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
This commit is contained in:
parent
900bd2f0ab
commit
7e77bf34f2
@ -587,13 +587,8 @@ class TestContainerTempurl(Base):
|
|||||||
def test_tempurl_keys_hidden_from_acl_readonly(self):
|
def test_tempurl_keys_hidden_from_acl_readonly(self):
|
||||||
if not tf.cluster_info.get('tempauth'):
|
if not tf.cluster_info.get('tempauth'):
|
||||||
raise SkipTest('TEMP AUTH SPECIFIC TEST')
|
raise SkipTest('TEMP AUTH SPECIFIC TEST')
|
||||||
original_token = self.env.container.conn.storage_token
|
metadata = self.env.container.info(cfg={
|
||||||
try:
|
'use_token': self.env.conn2.storage_token})
|
||||||
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
|
|
||||||
|
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
'tempurl_key', metadata,
|
'tempurl_key', metadata,
|
||||||
|
Loading…
Reference in New Issue
Block a user