Skip to content

added attachments#1732

Merged
jtopjian merged 5 commits intogophercloud:masterfrom
sbueringer:master
Oct 8, 2019
Merged

added attachments#1732
jtopjian merged 5 commits intogophercloud:masterfrom
sbueringer:master

Conversation

@sbueringer
Copy link
Copy Markdown
Contributor

@sbueringer sbueringer commented Oct 5, 2019

For #1731

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

@coveralls
Copy link
Copy Markdown

coveralls commented Oct 5, 2019

Coverage Status

Coverage decreased (-1.7%) to 76.387% when pulling dc79807 on sbueringer:master into 37f0256 on gophercloud:master.

@sbueringer
Copy link
Copy Markdown
Contributor Author

What should I do to not decrease the coverage? Not sure what the problem is :)

@jtopjian
Copy link
Copy Markdown
Contributor

jtopjian commented Oct 5, 2019

@sbueringer The coverage can be ignored - sometimes it calculates things oddly.

However, we do need to see the actual Nova python code where this feature is implemented. See here for more details and let me know if you have any questions.

@sbueringer
Copy link
Copy Markdown
Contributor Author

@jtopjian Okay thx. I added the link to the code where the os volume attachments are added above

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Oct 5, 2019

Build succeeded.

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

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

@sbueringer Thanks for adding the code reference.

I've left a comment about an alternative way of implementing this. Please let me know if you have any questions.

SecurityGroups []map[string]interface{} `json:"security_groups"`

// AttachedVolumes includes the volume attachments of this instance
AttachedVolumes []map[string]string `json:"os-extended-volumes:volumes_attached"`
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.

Instead of []map[string]string, how about:

type AttachedVolume struct {
  ID string `json:"id"`
}

and then

// AttachedVolumes includes the volume attachments of this instance
AttachedVolumes []AttachedVolume `json:"os-extended-volumes:volumes_attached"`

According to the code, id is the only field except if microversion 2.3+ is used, and then there is a delete_on_termination field. But since that's a microservice addition, we'll have to handle that differently, so let's not worry about that in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sounds good to me I pushed a fix.

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci bot commented Oct 7, 2019

Build succeeded.

@sbueringer
Copy link
Copy Markdown
Contributor Author

@jtopjian PTAL :)

Copy link
Copy Markdown
Contributor

@jtopjian jtopjian left a comment

Choose a reason for hiding this comment

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

LGTM - thank you!

@jtopjian jtopjian merged commit d02d262 into gophercloud:master Oct 8, 2019
@sbueringer
Copy link
Copy Markdown
Contributor Author

Thx for the fast review ;)

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.

3 participants