Juju should check earlier in the piece if the machine to hulk smash exists.
lucky(~/charms/precise/mediawiki) % juju deploy -v --to 9001 juju-gui
2013-08-15 05:25:31 INFO juju provider.go:121 environs/openstack: opening environment "nec-az3"
2013-08-15 05:25:35 INFO juju open.go:69 state: opening state; mongo addresses: ["15.185.243.11:37017"]; entity ""
2013-08-15 05:25:37 INFO juju open.go:107 state: connection established
2013-08-15 05:25:41 INFO juju conn.go:292 writing charm to storage [79337 bytes]
2013-08-15 05:25:45 INFO juju conn.go:304 adding charm to state
2013-08-15 05:26:08 ERROR juju supercommand.go:274 command failed: cannot assign unit "juju-gui/0" to machine: machine 9001 not found
error: cannot assign unit "juju-gui/0" to machine: machine 9001 not found
lucky(~/charms/precise/mediawiki) % juju deploy --to 9001 juju-gui
error: cannot add service "juju-gui": service already exists
lucky(~/charms/precise/mediawiki) % juju status
environment: nec-az3
machines:
"0":
agent-state: started
agent-version: 1.13.1
dns-name: 15.185.243.11
instance-id: "1686545"
series: precise
hardware: arch=amd64 cpu-cores=1 mem=1024M
services:
juju-gui:
charm: cs:precise/juju-gui-74
exposed: false
units:
juju-gui/0:
agent-state: pending
Submitted a pull request https:/ /github. com/juju/ juju/pull/ 268