Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit af69115

Browse files
committed
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
1 parent 47f71bb commit af69115

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,26 @@ func configFromEnv() (cfg Config, ok bool) {
412412
cfg.Global.Username = os.Getenv("OS_USERNAME")
413413
cfg.Global.Password = os.Getenv("OS_PASSWORD")
414414
cfg.Global.Region = os.Getenv("OS_REGION_NAME")
415+
416+
cfg.Global.TenantName = os.Getenv("OS_TENANT_NAME")
417+
if cfg.Global.TenantName == "" {
418+
cfg.Global.TenantName = os.Getenv("OS_PROJECT_NAME")
419+
}
420+
421+
cfg.Global.TenantId = os.Getenv("OS_TENANT_ID")
422+
if cfg.Global.TenantId == "" {
423+
cfg.Global.TenantId = os.Getenv("OS_PROJECT_ID")
424+
}
425+
415426
cfg.Global.DomainId = os.Getenv("OS_DOMAIN_ID")
427+
if cfg.Global.DomainId == "" {
428+
cfg.Global.DomainId = os.Getenv("OS_USER_DOMAIN_ID")
429+
}
430+
416431
cfg.Global.DomainName = os.Getenv("OS_DOMAIN_NAME")
432+
if cfg.Global.DomainName == "" {
433+
cfg.Global.DomainName = os.Getenv("OS_USER_DOMAIN_NAME")
434+
}
417435

418436
ok = (cfg.Global.AuthUrl != "" &&
419437
cfg.Global.Username != "" &&

0 commit comments

Comments
 (0)