Beispiel #1
0
 def setUp(self):
     super(OpenStackCredentialTestCase, self).setUp()
     cred_cls = credential.get("openstack")
     self.credential = cred_cls(
         "foo_url", "foo_user", "foo_password",
         tenant_name="foo_tenant",
         permission=consts.EndpointPermission.ADMIN)
Beispiel #2
0
 def setUp(self):
     super(OpenStackCredentialTestCase, self).setUp()
     cred_cls = credential.get("openstack")
     self.credential = cred_cls(
         "foo_url", "foo_user", "foo_password",
         tenant_name="foo_tenant",
         permission=consts.EndpointPermission.ADMIN)
Beispiel #3
0
    def get_credentials_for(self, platform):
        if platform == "default":
            return {"admin": None, "users": []}
        try:
            creds = self.deployment["credentials"][platform][0]
        except (KeyError, IndexError):
            raise exceptions.RallyException(
                "No credentials found for %s" % platform)

        admin = creds["admin"]
        credential_cls = credential.get(platform)
        return {"admin": credential_cls(**admin) if admin else None,
                "users": [credential_cls(**user) for user in creds["users"]]}
Beispiel #4
0
    def get_credentials_for(self, namespace):
        if namespace == "default":
            return {"admin": None, "users": []}
        try:
            creds = self.deployment["credentials"][namespace][0]
        except (KeyError, IndexError) as e:
            LOG.exception(e)
            raise exceptions.RallyException(_(
                "No credentials found for %s") % namespace)

        admin = creds["admin"]
        credential_cls = credential.get(namespace)
        return {"admin": credential_cls(**admin) if admin else None,
                "users": [credential_cls(**user) for user in creds["users"]]}
Beispiel #5
0
 def get_all_credentials(self):
     all_credentials = {}
     for platform in self.get_platforms():
         all_credentials[platform] = []
         credential_cls = credential.get(platform)
         for credentials in self.deployment["credentials"][platform]:
             try:
                 admin = credentials["admin"]
             except Exception:
                 raise KeyError(credentials)
             all_credentials[platform].append({
                 "admin": credential_cls(**admin) if admin else None,
                 "users": [credential_cls(**user) for user in
                           credentials["users"]]})
     return all_credentials
Beispiel #6
0
 def get_all_credentials(self):
     all_credentials = {}
     for platform in self.get_platforms():
         all_credentials[platform] = []
         credential_cls = credential.get(platform)
         for credentials in self.deployment["credentials"][platform]:
             try:
                 admin = credentials["admin"]
             except Exception:
                 raise KeyError(credentials)
             all_credentials[platform].append({
                 "admin": credential_cls(**admin) if admin else None,
                 "users": [credential_cls(**user) for user in
                           credentials["users"]]})
     return all_credentials
Beispiel #7
0
    def get_credentials_for(self, platform):
        if platform == "default":
            return {"admin": None, "users": []}
        try:
            creds = self.deployment["credentials"][platform][0]
        except (KeyError, IndexError):
            raise exceptions.RallyException("No credentials found for %s" %
                                            platform)

        admin = creds["admin"]
        credential_cls = credential.get(platform)
        return {
            "admin": credential_cls(**admin) if admin else None,
            "users": [credential_cls(**user) for user in creds["users"]]
        }
Beispiel #8
0
 def get_validation_context(self):
     ctx = {}
     for platform in self.get_platforms():
         ctx.update(credential.get(platform).get_validation_context())
     return ctx
Beispiel #9
0
 def get_validation_context(self):
     ctx = {}
     for platform in self.get_platforms():
         ctx.update(credential.get(platform).get_validation_context())
     return ctx
Beispiel #10
0
 def setUp(self):
     super(CredentialTestCase, self).setUp()
     self.cred_cls = credential.get("foo")
Beispiel #11
0
 def setUp(self):
     super(CredentialTestCase, self).setUp()
     self.cred_cls = credential.get("foo")