From 8b398c3ac68ae94f51a09c5d9c529afbc9efd642 Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Fri, 29 Mar 2019 15:59:54 +0200 Subject: [PATCH] Fix AttributeError for tempest verifier In case of missing admin credentials, rally is raising unexpected and not userfriendly AttributeError. This patch is fixing this. Change-Id: I5da96a7508f14626d0db9c7cbf817d66452af4ee --- rally_openstack/verification/tempest/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rally_openstack/verification/tempest/config.py b/rally_openstack/verification/tempest/config.py index 4bf08387..26e02a61 100644 --- a/rally_openstack/verification/tempest/config.py +++ b/rally_openstack/verification/tempest/config.py @@ -34,6 +34,12 @@ class TempestConfigfileManager(object): def __init__(self, deployment): self.credential = deployment.get_credentials_for("openstack")["admin"] + if not self.credential: + raise exceptions.ValidationError( + "Failed to configure 'tempest' for '%s' environment since " + "admin credentials for OpenStack platform is missed there." % + deployment["name"] + ) self.clients = self.credential.clients() self.available_services = self.clients.services().values()