Comment 4 for bug 1641224

Revision history for this message
Goran Miskovic (schkovich) wrote :

I believe that the original problem was not fixed.

Juju is complaining about spaces in the instace_type value.

juju --debug deploy ~/charms/bionic/webserver tomcms --config ~/charms/bionic/cmsadmin.yaml --series bionic --constraints "instance-type=3.75 GB Compute v1"
00:55:20 INFO juju.cmd supercommand.go:57 running juju [2.5.4 gc go1.10.4]
00:55:20 DEBUG juju.cmd supercommand.go:58 args: []string{"/snap/juju/7206/bin/juju", "--debug", "deploy", "~/charms/bionic/webserver", "tomcms", "--config", "~/charms/bionic/cmsadmin.yaml", "--series", "bionic", "--constraints", "instance-type=3.75 GB Compute v1"}
ERROR malformed constraint "GB"
00:55:20 DEBUG cmd supercommand.go:496 error stack:
/build/juju/parts/juju/go/src/github.com/juju/juju/constraints/constraints.go:413: malformed constraint "GB"
/build/juju/parts/juju/go/src/github.com/juju/juju/constraints/constraints.go:318:

Since multiple constraints are separated by space eg --constraints "mem=5G cores=2" parssing value --constraints "instance-type=3.75 GB Compute v1" will obviously fail.

See https://github.com/juju/juju/blob/1db915832ead46583f32341ad04753fb5c93c07d/core/constraints/constraints.go#L328

Perhaps urldecode might be a way to go. urlenclded value as "instance-type=3.75%20GB%20Compute%20v1" will pass validation but unless decoded, the value will not match valid values.