kapilt / juju-digitalocean

JuDo - A juju provider for digital ocean using a client side plugin and manual provisioning.
111 stars 17 forks source link

Destroy environment fails #5

Closed marcoceppi closed 10 years ago

marcoceppi commented 10 years ago
marco@xps-13:~/Projects$ juju docean destroy-environment
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): api.digitalocean.com
INFO:juju.docean:Terminating machines 1 2
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): api.digitalocean.com
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): api.digitalocean.com
INFO:urllib3.connectionpool:Starting new HTTPS connection (1): api.digitalocean.com
INFO:juju.docean:Destroying environment
ERROR destroying environment: manually provisioned machines must first be destroyed with `juju destroy-machine 1 2`
ERROR:juju.docean:Failed to run command juju destroy-environment -y docean

Traceback (most recent call last):
  File "/usr/local/bin/juju-docean", line 9, in <module>
    load_entry_point('juju-docean==0.0.8', 'console_scripts', 'juju-docean')()
  File "/usr/local/lib/python2.7/dist-packages/juju_docean-0.0.8-py2.7.egg/juju_docean/cli.py", line 96, in main
    cmd.run()
  File "/usr/local/lib/python2.7/dist-packages/juju_docean-0.0.8-py2.7.egg/juju_docean/commands.py", line 192, in run
    self.env.destroy_environment()
  File "/usr/local/lib/python2.7/dist-packages/juju_docean-0.0.8-py2.7.egg/juju_docean/env.py", line 47, in destroy_environment
    self.config.get_env_name()])
  File "/usr/local/lib/python2.7/dist-packages/juju_docean-0.0.8-py2.7.egg/juju_docean/env.py", line 27, in _run
    return subprocess.check_output(args, env=env, stderr=stderr)
  File "/usr/lib/python2.7/subprocess.py", line 573, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['juju', 'destroy-environment', '-y', 'docean']' returned non-zero exit status 1
ERROR exit status 1
kapilt commented 10 years ago

you can rerun it and it should work.. the issue is manual provider wants no other machines besides state-server/bootstrap, but machine deletion is async.. so code should either auto-retry or sleep to work around.

kapilt commented 10 years ago

pushed a slightly crappy workaround in the form of a sleep