Skip to content

Commit

Permalink
Merge pull request #376 from QuentinPerez/fix-374
Browse files Browse the repository at this point in the history
Invalid error message
  • Loading branch information
Quentin Perez authored Jul 1, 2016
2 parents 4d30217 + ef3ea68 commit efbc67e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ $ scw inspect myserver | jq '.[0].public_ip.address'

### master (unreleased)

* Fix error message with `--commercial-type=c2m` ([#374](https://github.com/scaleway/scaleway-cli/issues/374))
* Add Logger Interface to avoid multiples dependencies in the API, thank you [@nicolai86](https://github.com/nicolai86) ([#369](https://github.com/scaleway/scaleway-cli/pull/369))
* `scw run` handle `--ipv6` flag
* `scw create` handle `--ipv6` flag
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (e ScalewayAPIError) Error() string {
"Message": e.Message,
"APIMessage": e.APIMessage,
} {
fmt.Fprintf(&b, " %-30s %s", fmt.Sprintf("%s: ", k), v)
fmt.Fprintf(&b, "%s: %v ", k, v)
}
return b.String()
}
Expand Down
3 changes: 3 additions & 0 deletions pkg/api/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,14 @@ func CreateServer(api *ScalewayAPI, c *ConfigCreateServer) (string, error) {
}
arch := os.Getenv("SCW_TARGET_ARCH")
if arch == "" {
server.CommercialType = strings.ToUpper(server.CommercialType)
switch server.CommercialType[:2] {
case "C1":
arch = "arm"
case "C2", "VC":
arch = "x86_64"
default:
return "", fmt.Errorf("%s wrong commercial type", server.CommercialType)
}
}
region := os.Getenv("SCW_TARGET_REGION")
Expand Down

0 comments on commit efbc67e

Please sign in to comment.