yaml file multiple groups throws openstack.exceptions.ConfigException Cloud not found
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openstacksdk |
New
|
Undecided
|
Unassigned |
Bug Description
Today I faced an error but I'm not sure what to add in the original module's codes to fix.
This is my yaml file:
```
clouds:
all:
region1:
auth:
auth_url: http://
regions:
- RegionOne
interface: "public"
identity_
auth_type: "v3applicationc
region2:
auth:
auth_url: http://
regions:
- RegionTwo
interface: "public"
identity_
auth_type: "v3applicationc
region3:
auth:
auth_url: http://
regions:
- RegionThree
interface: "public"
identity_
auth_type: "v3applicationc
regionA:
region1:
auth:
auth_url: http://
regions:
- RegionOne
interface: "public"
identity_
auth_type: "v3applicationc
regionB:
region2:
auth:
auth_url: http://
regions:
- RegionTwo
interface: "public"
identity_
auth_type: "v3applicationc
region3:
auth:
auth_url: http://
regions:
- RegionThree
interface: "public"
identity_
auth_type: "v3applicationc
```
This is my python code that I'm trying to iterate over `regionB`'s regions to check the server list:
```
import openstack
import yaml
with open('clouds.yaml', 'r') as f:
reg = yaml.safe_load(f)
all_regions = []
for name in reg['clouds'
all_
regionA = []
for name in reg['clouds'
iran_
regionB = []
for name in reg['clouds'
foreign_
# Initialize and turn on debug logging
openstack.
# Initialize connection
for region in all_regions:
conn1 = openstack.
# conn2 = openstack.
# List the servers
for server in conn1.compute.
# for server in conn2.compute.
if server['name'] == 'some-name':
result = server.to_dict()
result
```
This is the error I get for `conn1`:
```
openstack.
```
And this is the error of `conn2`:
```
openstack.
```
I checked [loader.py](https:/
```
clouds:
region1:
region2:
region3:
```
But I'm going to have some groups in a single file. I know I can have multiple file but I'm looking for a way to see if I can do what I'm looking for.
At this moment I'm not sure how to edit the files to achieve what I want, but if I found I'll update this PR.