Skip to content

Commit

Permalink
Improve logging on the policyd tests
Browse files Browse the repository at this point in the history
This has no 'testing' changes, just improves the logging output.
  • Loading branch information
ajkavanagh committed Oct 7, 2019
1 parent 3b6a511 commit 81c4432
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions zaza/openstack/charm_tests/policyd/tests.py
Expand Up @@ -395,16 +395,15 @@ def test_003_test_overide_is_observed(self):
"Service action passed and should have failed.")
except PolicydOperationFailedException:
pass
except zaza_exceptions.PolicydError:
logging.info("Policy override worked.")
except zaza_exceptions.PolicydError as e:
logging.info("{}".format(str(e)))
raise
except Exception as e:
logging.info("exception was: {}".format(e.__class__.__name__))
import traceback
logging.info(traceback.format_exc())
raise zaza_exceptions.PolicydError(
'Retrieve service action as demo user with domain scoped '
'token failed: "{}"'
'Service action failed in an unexpected way: {}'
.format(str(e)))

# clean out the policy and wait
Expand Down Expand Up @@ -523,7 +522,8 @@ def get_client_and_attempt_operation(self, ip):
glance_client = openstack_utils.get_glance_session_client(
self.get_keystone_session_demo_user(ip))
try:
glance_client.images.list()
images = list(glance_client.images.list())
logging.debug("images is: {}".format(images))
except glanceclient.common.exceptions.HTTPForbidden:
raise PolicydOperationFailedException()

Expand Down

0 comments on commit 81c4432

Please sign in to comment.