Skip to content

Shared Filesystems: Share Export Locations - #381

Merged
jtopjian merged 3 commits into
gophercloud:masterfrom
pospispa:get-list-of-export-locations
Aug 11, 2017
Merged

jtopjian merged 3 commits into
gophercloud:masterfrom
pospispa:get-list-of-export-locations

Conversation

@pospispa

@pospispa pospispa commented Jun 14, 2017 •

Copy link
Copy Markdown
Contributor

For #380

Links to the line numbers/files in the OpenStack source code that support the
code in this PR:

https://github.com/openstack/manila/blob/master/manila/api/v2/share_export_locations.py#L25

@coveralls

coveralls commented Jun 14, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 70.547% when pulling 9260137 on pospispa:get-list-of-export-locations into 8d5b28e on gophercloud:master.

@pospispa
pospispa force-pushed the get-list-of-export-locations branch from 9260137 to e63f72a Compare June 16, 2017 10:53
@pospispa
pospispa force-pushed the get-list-of-export-locations branch from e63f72a to 56c4efc Compare June 26, 2017 11:48
@pospispa pospispa changed the title [Pending #342] [Pending #346] Shared Filesystems: Share Export Locations [Pending #409] [Pending #346] Shared Filesystems: Share Export Locations Jun 26, 2017
@pospispa
pospispa force-pushed the get-list-of-export-locations branch from 56c4efc to 5561eaf Compare June 26, 2017 11:58
@coveralls

coveralls commented Jun 26, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.2%) to 70.781% when pulling 5561eaf on pospispa:get-list-of-export-locations into 5102b60 on gophercloud:master.

@pospispa pospispa changed the title [Pending #409] [Pending #346] Shared Filesystems: Share Export Locations [Pending #346] Shared Filesystems: Share Export Locations Jul 20, 2017
@pospispa
pospispa force-pushed the get-list-of-export-locations branch from 5561eaf to 9eb7beb Compare July 20, 2017 17:44
@coveralls

coveralls commented Jul 20, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.3%) to 70.862% when pulling 9eb7beb on pospispa:get-list-of-export-locations into 4af874e on gophercloud:master.

@pospispa pospispa changed the title [Pending #346] Shared Filesystems: Share Export Locations Shared Filesystems: Share Export Locations Aug 9, 2017
pospispa added 2 commits August 9, 2017 12:28
In order to mount a share one needs to know the share export location.

That's why the Get Share Export Locations request is added.
@pospispa
pospispa force-pushed the get-list-of-export-locations branch from 9eb7beb to 7b621d3 Compare August 9, 2017 10:38
@pospispa

pospispa commented Aug 9, 2017

Copy link
Copy Markdown
Contributor Author

@jtopjian can we just add the Get Export Locations functionality without microversion check and let the server return an error in case the client did not use a proper microversion?

Should I create an issue that the microversion check shall be added later?

@coveralls

coveralls commented Aug 9, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 71.492% when pulling 7b621d3 on pospispa:get-list-of-export-locations into c0406a1 on gophercloud:master.

@jtopjian jtopjian left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pospispa Just a few small changes to this one and it should be good to go.

Path string `json:"path"`
// The UUID of the share instance that this export location belongs to.
ShareInstanceID string `json:"share_instance_id"`
// Defines purpose of an export location. If set to true, then it is expected to be used for service needs and by administrators only. If it is set to false, then this export location can be used by end users.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you wrap this comment to around 80 characters?

IsAdminOnly bool `json:"is_admin_only"`
// The share export location UUID.
ID string `json:"id"`
// Drivers may use this field to identify which export locations are most efficient and should be used preferentially by clients. By default it is set to false value. New in version 2.14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Can you wrap this comment to around 80 characters?

// ExtractExportLocations will get the Export Locations from the commonResult
func (r commonResult) ExtractExportLocations() ([]ExportLocation, error) {
var s struct {
GetExportLocationsRes []ExportLocation `json:"export_locations"`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be:

ExportLocations  []ExportLocation `json:"export_locations"`

@coveralls

coveralls commented Aug 10, 2017 •

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.04%) to 71.492% when pulling a41308e on pospispa:get-list-of-export-locations into c0406a1 on gophercloud:master.

@pospispa

Copy link
Copy Markdown
Contributor Author

@jtopjian I believe I have addressed all your comments and I created #447 in order to add a microversion check later.

@jtopjian

Copy link
Copy Markdown
Contributor

This looks good to me. I was able to get a share created in a test environment and the API results matched with what's here and in the referenced Manila code.

@jtopjian
jtopjian merged commit 4ecdf7c into gophercloud:master Aug 11, 2017
}

// ExtractExportLocations will get the Export Locations from the commonResult
func (r commonResult) ExtractExportLocations() ([]ExportLocation, error) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a commonResult instead of a GetExportLocationResult? Can every response type extract this data?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I caught that as well last night and I saw something else in the sharedfilesystems packages that made me think it was ok, but I most likely got it mixed up with the same occurrence in #346.

I doubt this is function is applicable to all. I don't see how a share result can extract this information. I can follow-up with a PR to fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! This is what it was: https://github.com/gophercloud/gophercloud/blob/master/openstack/sharedfilesystems/v2/sharenetworks/results.go#L172-L182

But upon reading further, I see that those actions return a share network and not some other result. So this is my mistake for not reading further.

pospispa pushed a commit to pospispa/gophercloud that referenced this pull request Aug 11, 2017
cardoe pushed a commit to cardoe/gophercloud that referenced this pull request Aug 27, 2020
New versions of OpenStack are automatically adding a property
of os_hidden with a boolean value. This is conflicting with
Terraform's TypeMap which expects all values to be a string.

This commit fixes the issue by filtering out non-string
properties.
msheikh-wind pushed a commit to msheikh-wind/gophercloud that referenced this pull request May 19, 2025
This commit updates the task to monitor the SSH port closure using
local_action to avoid remote not reachable. This change aligns with
StarlingX upstream code:
https://opendev.org/starlingx/ansible-playbooks/src/branch/master/playbookconfig/src/playbooks/roles/common/host-unlock/tasks/main.yml#L46-L62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants