tormath1 commented on this pull request.


>           checkArgument(!iterator.hasNext(),
                "Error: Please specify only one network/subnetwork in 
TemplateOptions when using GCE.");
       }
 
       String region = ZONE == location.getScope() ? 
location.getParent().getId() : location.getId();
-      Optional<Subnetwork> subnet = 
subnetworksMap.getUnchecked(fromRegionAndName(region, networkName));
+      Optional<Subnetwork> subnet;
+
+      subnet = isFullURI ? 
Optional.fromNullable(resources.subnetwork(URI.create(net))) : 
subnetworksMap.getUnchecked(fromRegionAndName(region, networkName));

Ok. But a shared VPC is identified by his `host project`, `region` and `name` 
and a classical subnetwork is only identified by his `region` and `name`, the 
`project` is given by the service account. 
In my opinon, if a user wants to use a shared VPC, it'll have to give the full 
URI and if he wants to use a classical subnetwork, it'll have to give only the 
`region` and `name`. In this way, we are not breaking the compatibility. 
This is why, I am checking if the given `net` is like 
`projects/<project>/regions/<region>/subnetworks/<subnetwork>`.

-- 
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/pull/1236#discussion_r214167148

Reply via email to