> @@ -116,7 +117,14 @@ public boolean
> apply(org.jclouds.digitalocean.domain.Image input) {
> @Override
> public boolean deleteImage(String id) {
> try {
> - api.getImageApi().delete(Integer.parseInt(id));
> + // The id of the image can be an id or a slug. Use the
> corresponding method of the API depending on what is
> + // provided. If it can be parsed as a number, use the method to
> destroy by ID. Otherwise, destroy by slug.
> + Integer imageId = Ints.tryParse(id);
> + if (imageId != null) {
> + api.getImageApi().delete(imageId);
> + } else {
> + api.getImageApi().delete(id);
Sure. Will also add some debug logging to the compute functions, when an image
is no longer available.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/63/files#r12831391