jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrea Turli <notificati...@github.com>
Subject Re: [jclouds/jclouds-labs] [JCLOUDS-1430] Aliyun ECS (#443)
Date Thu, 02 Aug 2018 08:10:57 GMT
andreaturli commented on this pull request.



> +         } else {
+            logger.warn(">> security group: (%s) has not been deleted.", securityGroupId);
+         }
+      }
+
+      return instanceDeleted;
+   }
+
+   private List<String> getSecurityGroupIdsUsedByNode(RegionAndId regionAndId) {
+      List<String> securityGroupIds = Lists.newArrayList();
+      PaginatedCollection<Instance> instances = api.instanceApi().list(regionAndId.regionId(),
ListInstancesOptions.Builder.instanceIds(regionAndId.id()));
+      if (instances.isEmpty()) return securityGroupIds;
+
+      Instance instance = Iterables.get(instances, 0);
+      if (instance != null && !instance.securityGroupIds().isEmpty()) {
+         securityGroupIds = instance.securityGroupIds().values().iterator().next();

again it's a list ;)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/443#discussion_r207136327
Mime
View raw message