def backup_users(): users = [] for name in list_node(User, 'users'): user = User(name) info = { 'name': user.name, 'status': user.status, 'policies': format_policies([(p, user.get_policy(p)) for p in user.allowed_policy_types]), 'roles': [Role(object_ref=r).name for r in user.roles] } users.append(info) print("USERS:", *users, sep='\n\t') return users
def test_user_statement(self): name = "*****@*****.**" User.provision_user(name, statement=self.default_policy) test_user = User(name) self.assertJSONEqual(test_user.get_policy(), self.default_policy)