Merge "Ensure reverting test env if the env is temporarily changed"

This commit is contained in:
Zuul 2018-03-15 02:19:40 +00:00 committed by Gerrit Code Review
commit f2e8565bb6
1 changed files with 6 additions and 3 deletions

View File

@ -588,9 +588,12 @@ class TestContainerTempurl(Base):
if not tf.cluster_info.get('tempauth'):
raise SkipTest('TEMP AUTH SPECIFIC TEST')
original_token = self.env.container.conn.storage_token
self.env.container.conn.storage_token = self.env.conn2.storage_token
metadata = self.env.container.info()
self.env.container.conn.storage_token = original_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
self.assertNotIn(
'tempurl_key', metadata,