> +      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));
> +            }
> +
> +            // Get the first available ip
> +            Ip<?, ?> availableIp = get(network.listUnusedIps(), 0);
> +            logger.debug(">> Found available %s ip %s", 
> availableIp.getNetworkType().name().toLowerCase(),

Why `toLowerCase()`? For debugging, wouldn't it be easier to see the actual 
name?

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

Reply via email to