> @@ -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);

Would this be a good place for some debug logging?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/63/files#r12805564

Reply via email to