andreaturli commented on this pull request.


>  
-      getOrCreateVirtualNetworkWithSubnet(location, options, azureGroupName);
-      configureSecurityGroupForOptions(group, azureGroupName, 
template.getLocation(), options);
+      createResourceGroupIfNeeded(group, location, options);

I think you are right although I'd probably prefer to read something like
```
...
      if (options.getResourceGroup() != null) {
         group = options.getResourceGroup();
      }


   private ResourceGroup getOrCreateResourceGroup(String group, String 
location) {
      if (group != null) {
      logger.debug(">> using resource group [%s]", group);
      ResourceGroup rg = api.getResourceGroupApi().get(group);
      if (rg != null)  return rg;

      logger.debug(">> resource group [%s] does not exist. Creating!", group);
      return api.getResourceGroupApi().create(group, location,
            ImmutableMap.of("description", "jclouds default resource group"));
      }
   }
```
and then set the resourceGroup.name on the options object where needed.

but maybe it is not significantly better. Again, just a minor comment :)

-- 
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/385#discussion_r113126917

Reply via email to