Skip to content

Commit

Permalink
Fix update config --account returning BillingAccountNotFound error.
Browse files Browse the repository at this point in the history
  • Loading branch information
telyn committed May 14, 2018
1 parent 5cf2c38 commit 875ddd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/bytemark/commands/update/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,12 @@ func (variables configVars) configFlags() (flags []cli.Flag) {
func validateAccountForConfig(c *app.Context, name string) (err error) {
_, err = c.Client().GetAccount(name)
if err != nil {
if _, ok := err.(lib.NotFoundError); ok {
switch err.(type) {
case lib.NotFoundError:
return fmt.Errorf("No such account %s - check your typing and specify --yubikey if necessary", name)
case lib.BillingAccountNotFound:
return nil
}
return err
}
return
}
Expand Down
8 changes: 8 additions & 0 deletions doc/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
bytemark-client (3.2) UNRELEASED; urgency=low

### Fixes:
* `update config --account <account>` no longer fails if a billing account
cannot be found for the named account (but a Bytemark Cloud account can)

-- telyn <telyn@bytemark.co.uk> Mon, 14 May 2018 11:31:25 +0100

bytemark-client (3.1) UNRELEASED; urgency=low

### Admin changes:
Expand Down

0 comments on commit 875ddd7

Please sign in to comment.