Bug #10109
openUnable to create hosts after upgrading - undefined method `name' for nil:NilClass
Description
Log Entry: Failed to create a compute MyDO (DigitalOcean) instance newhost.domain.com: undefined method `name' for nil:NilClass
If you have upgraded the DigitalOcean plugin to 0.1.0 after creating your Compute Resource, it will not have the appropriate SSH Key associated with it, and will fail. This is a bug because it should more "gracefully" detect this and generate the key. This could also potentially be a problem if the key was removed from Digital Ocean by someone in the WebUI. (not confirmed) See below for workaround...
Backtrace:
```
Failed to create a compute MyDO (DigitalOcean) instance pla-devapp-01.do.lark-it.com: undefined method `name' for nil:NilClass
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_digitalocean-0.1.0/app/models/foreman_digitalocean/digitalocean.rb:137:in `block in ssh_key'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_digitalocean-0.1.0/app/models/foreman_digitalocean/digitalocean.rb:137:in `select'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_digitalocean-0.1.0/app/models/foreman_digitalocean/digitalocean.rb:137:in `ssh_key'
/opt/rh/ruby193/root/usr/share/gems/gems/foreman_digitalocean-0.1.0/app/models/foreman_digitalocean/digitalocean.rb:39:in `create_vm'
/usr/share/foreman/app/models/concerns/orchestration/compute.rb:74:in `setCompute'
/usr/share/foreman/app/models/concerns/orchestration.rb:137:in `execute'
/usr/share/foreman/app/models/concerns/orchestration.rb:85:in `block in process'
/usr/share/foreman/app/models/concerns/orchestration.rb:77:in `each'
/usr/share/foreman/app/models/concerns/orchestration.rb:77:in `process'
/usr/share/foreman/app/models/concerns/orchestration.rb:18:in `on_save'
```