-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use cdroms len instead of ISOPaths len #394
Conversation
It's a pattern that re-appears in the code, let's deduplicate that.
There's special case when option `remove_cdrom` is set that there would be zero cdrom devices by the time `reattach_cdroms` processing is executed, so the comparison to ISOPaths len is wrong. Instead use the amount of cdroms we have at that point. Fixes: hashicorp#393
Okay, ready for review.
Please review 😊 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll give these changes and some common and corner cases a spin in my environments tomorrow and report back the results so we can move forward.
Adds the documentation for `reattach_cdroms` to the generated documentation. Signed-off-by: Ryan Johnson <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
Tested with multiple cases and variations and the results were as expected.
I've also added a commit to attach the option into the generated documentation.
Cool, thank you! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done - the changes look good to me. Thanks for validating @tenthirtyam
ISOPaths
to figure out amount of cdroms, but that's not really correct and this assumption breaks whenremove_cdrom
is set. Fix the problem by making use of the function listing the devices that was added in prev. commit.EjectCdrom
, which seems to be correct because after it's called we should no longer have paths mounted, only the actual cdrom hw devices. With that said, it seems this does not have any influence on the tests right now.Fixes: #393