better warnings and comments on use of `networkName` in JcloudsLocation

Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/8e996741
Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/8e996741
Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/8e996741

Branch: refs/heads/master
Commit: 8e9967413913a3982a6e6d6e57735a13fdbc696d
Parents: 56285ad
Author: Alex Heneveld <[email protected]>
Authored: Tue Jun 23 23:12:07 2015 -0700
Committer: Alex Heneveld <[email protected]>
Committed: Wed Jun 24 01:04:24 2015 -0700

----------------------------------------------------------------------
 .../brooklyn/location/jclouds/JcloudsLocation.java  | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/8e996741/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
----------------------------------------------------------------------
diff --git 
a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
 
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
index 969d41d..7797138 100644
--- 
a/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
+++ 
b/locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
@@ -1257,14 +1257,20 @@ public class JcloudsLocation extends 
AbstractCloudMachineProvisioningLocation im
                             ((AWSEC2TemplateOptions)t).subnetId((String)v);
                             
                         } else {
-                            if (t instanceof SoftLayerTemplateOptions) {
-                                LOG.warn("networkName may not be supported in 
SoftLayer; use `templateOptions` with `primaryNetworkComponentNetworkVlanId` or 
`primaryNetworkBackendComponentNetworkVlanId`");
+                            if (t instanceof 
GoogleComputeEngineTemplateOptions) {
+                                // no warning needed
+                                // we think this is the only jclouds endpoint 
which supports this option
+                                
+                            } else if (t instanceof SoftLayerTemplateOptions) {
+                                LOG.warn("networkName is not be supported in 
SoftLayer; use `templateOptions` with `primaryNetworkComponentNetworkVlanId` or 
`primaryNetworkBackendComponentNetworkVlanId`");
                             } else if (!(t instanceof 
CloudStackTemplateOptions) && !(t instanceof NovaTemplateOptions)) {
-                                LOG.warn("networkName may not be supported in 
this cloud; only known to work in CloudStack and OpenStack");
+                                LOG.warn("networkName is experimental in many 
jclouds endpoints may not be supported in this cloud");
+                                // NB, from @andreaturli
+//                                Cloudstack uses custom securityGroupIds and 
networkIds not the generic networks
+//                                Openstack Nova uses securityGroupNames which 
is marked as @deprecated (suggests to use groups which is maybe even more 
confusing)
+//                                Azure supports the custom 
networkSecurityGroupName
                             }
                             
-                            // looks like this is only supported in Cloudstack 
and Openstack
-                            // should we log warning if using another cloud?
                             t.networks((String)v);
                         }
                     }})

Reply via email to