jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <notificati...@github.com>
Subject Re: [jclouds-labs] [JCLOUDS-849] All tests are green (#158)
Date Thu, 02 Apr 2015 10:24:36 GMT
> +              prioritizeCredentialsFromTemplate,
> +              client,
> +              nodeMetadataAdapter,
> +              imageAdapter,
> +              addDefaultCredentialsToImage);
> +
> +      this.client = (AzureComputeServiceAdapter) client;
> +      this.nodeMetadataAdapter = nodeMetadataAdapter;
> +   }
> +
> +   @Override
> +   public NodeMetadata destroyNode(final String id) {
> +      final Deployment node = client.internalDestroyNode(id);
> +      return node == null
> +              ? null
> +              : nodeMetadataAdapter.apply(node);

The [default implementation of destroyNode()](https://github.com/jclouds/jclouds/blob/master/compute/src/main/java/org/jclouds/compute/strategy/impl/AdaptingComputeServiceStrategies.java#L177)
will simply rely on `getNode()` and, if such method returns NULL, not perform any delete.

The `getNode()` logic in Azure needs to be handled in a slightly different way (a "node" is
returned only when the CloudService is available and all RoleInstance elements are in a non-transient
state) so we implemented the logic for a sort of "getNode for destroy" in the `internalDestroyNode`.


---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/158/files#r27646053
Mime
View raw message