Skip to content

Tenant is considered supplied if tenantName or tenantId are an empty String. #104

@ghost

Description

Using the following config;

AccountConfig config = new AccountConfig();  
config.setUsername("username");
config.setPassword("password");
config.setAuthUrl("authurl");
config.setTenantName("");
config.setTenantId("");
account = new AccountFactory(config).createAccount();

I noticed that I was unable to authenticate, instead I got the following;

Command exception, HTTP Status code: 404 => NO_SERVICE_CATALOG_FOUND

Not setting the tenantName or tenantId seemed to resolve the issue. Looking at KeystoneAuthenticationCommandImpl, I noticed that it's checking if tenantName and tenantId are not null but does not consider if the strings are empty;

private void setTenantSupplied(String tenantName, String tenantId) {
  this.tenantSupplied = tenantName != null || tenantId != null;
}

To work around this I just avoided setting the tenantName or tenantId if I found that they were null or empty.

Apologies if this is covering a use case that has already been considered!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions