keystone: add v3 OS-FEDERATION extension List Mappings#2468
keystone: add v3 OS-FEDERATION extension List Mappings#2468mandre merged 3 commits intogophercloud:masterfrom
Conversation
|
I took the liberty to modify your PR description so that it's not going to close #2461 automatically upon merging this PR, as it appears there are more work needed for it. |
cae0d6f to
aeccb45
Compare
|
@mandre |
| mappings, err := federation.ExtractMappings(allPages) | ||
| th.AssertNoErr(t, err) | ||
|
|
||
| tools.PrintResource(t, mappings) |
There was a problem hiding this comment.
Is it expected mappings is null here?
Don't you need elevated privileges to list the federation mappings? In which case, I would have expected the call to return a 403 error. Not sure if this is a general issue with pagination in gophercloud or if this is related to this patch as I'm not really familiar about how the pagination works...
Also, we should probably be testing the mapping list after we have created a mapping first so that we confirm it works as expected.
There was a problem hiding this comment.
Yes, as long as (pagination.LinkedPageBase).ExtractInto assigns nil as an empty array.
I can create an acceptance test for CRUD (as I've seen in other sets) for create operation and verify that it works as expected. Is it fine with you to leave it as is?
There was a problem hiding this comment.
That's fine for now, I expect we call again ListMappings when implementing the acceptance tests for the mapping creation.
| client, err := clients.NewIdentityV3Client() | ||
| th.AssertNoErr(t, err) | ||
|
|
||
| allPages, err := federation.ListMappings(client).AllPages() |
There was a problem hiding this comment.
Please run go fmt on acceptance/openstack/identity/v3/federation_test.go. This is the reason why the unit tests fail.
| mappings, err := federation.ExtractMappings(allPages) | ||
| th.AssertNoErr(t, err) | ||
|
|
||
| tools.PrintResource(t, mappings) |
There was a problem hiding this comment.
That's fine for now, I expect we call again ListMappings when implementing the acceptance tests for the mapping creation.
For #2461
docs
code
After this is reviewed and merged other operations will follow.