Ability to run the openstack tests against DevStack

Some of the environment variables have changed as devstack defaults
have changed. So look for the older env variables first and try the
newer ones later.

At a minimum you need the following for v3 authentication which is
the default with latest devstack. If you miss the Tenant information
then the token issued will be a unscoped token (and will not have any
service catalog information).

OS_AUTH_URL=http://192.168.0.42/identity
OS_REGION_NAME=RegionOne
OS_USERNAME=demo
OS_PASSWORD=supersecret
OS_TENANT_NAME=demo
OS_USER_DOMAIN_ID=default
This commit is contained in:
Davanum Srinivas 2017-10-05 17:28:14 -04:00
parent 9af339885b
commit c04f04c229

View File

@ -412,8 +412,26 @@ func configFromEnv() (cfg Config, ok bool) {
cfg.Global.Username = os.Getenv("OS_USERNAME")
cfg.Global.Password = os.Getenv("OS_PASSWORD")
cfg.Global.Region = os.Getenv("OS_REGION_NAME")
cfg.Global.TenantName = os.Getenv("OS_TENANT_NAME")
if cfg.Global.TenantName == "" {
cfg.Global.TenantName = os.Getenv("OS_PROJECT_NAME")
}
cfg.Global.TenantId = os.Getenv("OS_TENANT_ID")
if cfg.Global.TenantId == "" {
cfg.Global.TenantId = os.Getenv("OS_PROJECT_ID")
}
cfg.Global.DomainId = os.Getenv("OS_DOMAIN_ID")
if cfg.Global.DomainId == "" {
cfg.Global.DomainId = os.Getenv("OS_USER_DOMAIN_ID")
}
cfg.Global.DomainName = os.Getenv("OS_DOMAIN_NAME")
if cfg.Global.DomainName == "" {
cfg.Global.DomainName = os.Getenv("OS_USER_DOMAIN_NAME")
}
ok = (cfg.Global.AuthUrl != "" &&
cfg.Global.Username != "" &&