> +    */
> +   private void configureNetworking(VirtualMachine vm, 
> VirtualApplianceCachingTemplate template, Datacenter datacenter,
> +         TemplateOptions options) {
> +
> +      if (!options.getNetworks().isEmpty()) {
> +         List<Ip<?, ?>> ips = Lists.newArrayList();
> +         Enterprise enterprise = adminService.getCurrentEnterprise();
> +         Iterable<ExternalNetwork> externalNetworks = 
> enterprise.listExternalNetworks(datacenter);
> +
> +         for (String networkId : options.getNetworks()) {
> +            Network<?> network = 
> template.getVirtualDatacenter().getPrivateNetwork(Ints.tryParse(networkId));
> +            if (network == null) {
> +               // If the given network is not a private network, it should 
> be an
> +               // external one
> +               network = find(externalNetworks, networkId(networkId));
> +            }

Is the `NoSuchElementException` that will be thrown here what we want? Or 
convert to `IllegalArg` or `IllegalState`?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/47/files#r8755771

Reply via email to