Switch from json.loads to yaml.safe_load for decoded usernames
In the rotate password test, the results from the action return a list of strings that are deliminted by single quotes. This isn't compatible with json.loads(), but yaml.safe_load() is able to load the string as an array of strings.
This commit is contained in:
@@ -21,6 +21,7 @@ import os
|
||||
import re
|
||||
import tempfile
|
||||
import tenacity
|
||||
import yaml
|
||||
|
||||
import zaza.charm_lifecycle.utils as lifecycle_utils
|
||||
import zaza.model
|
||||
@@ -615,7 +616,7 @@ class MySQLInnoDBClusterRotatePasswordTests(MySQLCommonTests):
|
||||
'list-service-usernames',
|
||||
action_params={}
|
||||
)
|
||||
usernames = json.loads(action.data['results']['usernames'])
|
||||
usernames = yaml.safe_load(action.data['results']['usernames'])
|
||||
logging.info("... usernames: %s", ', '.join(usernames))
|
||||
self.assertIn('keystone', usernames)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user