Skip to content
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

Use regex based approach to detect attached disks #6229

Merged
merged 1 commit into from
May 8, 2018
Merged

Use regex based approach to detect attached disks #6229

merged 1 commit into from
May 8, 2018

Conversation

DanHam
Copy link
Contributor

@DanHam DanHam commented May 2, 2018

This PR updates the code in step_clone to use a regexp based approach to detect attached disks. Overall, I believe this is a better approach as:

  • It doesn't use any hard coded values and so future proofs the code slightly.
  • It reduces complexity and makes the code easier/more obvious to read.

It follows the approach used here in step_clean...

Of course, these reasons can also be read as reasons why my previous code sucked slightly... so please consider this an attempt at making amends! 😄

@DanHam DanHam requested a review from a team as a code owner May 2, 2018 00:26
@SwampDragons
Copy link
Contributor

SwampDragons commented May 3, 2018

I think I'd like to see a comment explaining what the regex is looking for and why; generally I find that regexes are hard to understand at a glance and I'd like some note in here for maintainability.

@DanHam
Copy link
Contributor Author

DanHam commented May 8, 2018

@SwampDragons

I'd like to see a comment explaining what the regex is looking for and why; generally I find that regexes are hard to understand at a glance and I'd like some note in here for maintainability

Ditto on regexp's! I've now added a (somewhat lengthy) comment to try and explain why a regex is being used here. Is this the type of thing you were after? Or perhaps you feel this is a little too much?

Just let me know if you want me to have another go at that...

@SwampDragons
Copy link
Contributor

I was all ready to tease you for making a fifteen-line comment but then I read it and... I like it. Thanks for this.

@SwampDragons SwampDragons merged commit 84a7d24 into hashicorp:master May 8, 2018
@DanHam DanHam deleted the use-re-for-vmxadapter branch May 9, 2018 02:34
@SwampDragons SwampDragons added this to the 1.2.4 milestone May 24, 2018
@ghost
Copy link

ghost commented Mar 31, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants