Rephrase error message when agent versions != client version. #7911

Merged
merged 3 commits into from Oct 5, 2017

Conversation

Projects
None yet
3 participants
Member

anastasiamac commented Oct 5, 2017

Description of change

When bootstrapping controllers with agent version that is different from client version, we'd get a fairly obscure message:

$ juju bootstrap aws mycontroller --agent-version=2.2.3
ERROR requested agent version major.minor mismatch

To avoid surprises and headaches, this PR proposes to re-phrase this message in a user-friendly way:

$ juju bootstrap aws mycontroller --agent-version=2.2.3
ERROR this client can only bootstrap 2.3 agents

QA steps

As per description above.

Documentation changes

n/a

Bug reference

n/a

cmd/juju/commands/bootstrap.go
@@ -236,7 +236,7 @@ func (c *bootstrapCommand) Init(args []string) (err error) {
}
}
if c.AgentVersion != nil && (c.AgentVersion.Major != jujuversion.Current.Major || c.AgentVersion.Minor != jujuversion.Current.Minor) {
- return errors.New("requested agent version major.minor mismatch")
+ return errors.Errorf("this client can only bootstrap %v.%v+ agents", jujuversion.Current.Major, jujuversion.Current.Minor)
@wallyworld

wallyworld Oct 5, 2017

Owner

Just a thought
2.3+ could imply anything greater than 2.3, eg 2.4
How about
2.3.x

@anastasiamac

anastasiamac Oct 5, 2017

Member

Yes, I thought of that but then about about beta versions and such? they take form of, say 2.3-b3...

Maybe just drop suffix altogether? so "...can only bootstrap 2.3 agents"?

Member

anastasiamac commented Oct 5, 2017

$$merge$$

Contributor

jujubot commented Oct 5, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit 4605eb2 into juju:develop Oct 5, 2017

1 check passed

continuous-integration/jenkins/pr-merge This commit looks good
Details

@anastasiamac anastasiamac deleted the anastasiamac:clarify-err-msg branch Oct 5, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment