> + public ListenableFuture<Image> createImage(ImageTemplate template) {
> + checkState(template instanceof CloneImageTemplate, "profitbricks only
> supports creating images through cloning.");
> + final CloneImageTemplate cloneTemplate = (CloneImageTemplate) template;
> + String serverId = cloneTemplate.getSourceNodeId();
> +
> + Server server = api.serverApi().getServer(serverId);
> + Storage bootDevice = Iterables.find(server.storages(),
> matchBootDevice);
> +
> + final Snapshot requested = api.snapshotApi().createSnapshot(
> + Snapshot.Request.creatingBuilder()
> + .storageId(bootDevice.id())
> + .name(template.getName())
> + .description(template.getName() + " (created with jclouds)")
> + .build());
> +
> + logger.info(">> creating a snapshot from storage: " + bootDevice.id());
Better use the form `logger.info(">> creating a snapshot from storage: %s",
bootDevice.id());`. You save unnecessary string builders if the log level is
not active.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/929/files#r54737196