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

status commands handle uuid prefixes with hyphens #3122

Merged
merged 3 commits into from
Aug 29, 2017
Merged

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Aug 29, 2017

No description provided.

@@ -142,7 +142,7 @@ func (c *AllocStatusCommand) Run(args []string) int {
c.Ui.Error(fmt.Sprintf("Identifier must contain at least two characters."))
return 1
}
if len(allocID)%2 == 1 {
if hyphens := strings.Count(allocID, "-"); (len(allocID)-hyphens)%2 == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this is a good candidate for helpers.go?

@@ -130,7 +130,7 @@ func (c *EvalStatusCommand) Run(args []string) int {
c.Ui.Error(fmt.Sprintf("Identifier must contain at least two characters."))
return 1
}
if len(evalID)%2 == 1 {
if hyphens := strings.Count(evalID, "-"); (len(evalID)-hyphens)%2 == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be good to write a test to validate this behavior/bug fix

@dadgar dadgar merged commit f5d80c6 into master Aug 29, 2017
@dadgar dadgar deleted the b-even-uuids branch August 29, 2017 17:10
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants