From 8e7bec1c912918c572d7966c3c8f731aaf9805ce Mon Sep 17 00:00:00 2001 From: Adrian Cole Date: Fri, 18 May 2012 19:56:44 -0700 Subject: [PATCH] cloudservers works with tags now --- .../cloudservers/compute/functions/ServerToNodeMetadata.java | 3 ++- .../compute/strategy/CloudServersComputeServiceAdapter.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadata.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadata.java index 125c750f30..a161ad4aa3 100644 --- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadata.java +++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/functions/ServerToNodeMetadata.java @@ -19,6 +19,7 @@ package org.jclouds.cloudservers.compute.functions; import static com.google.common.base.Preconditions.checkNotNull; +import static org.jclouds.compute.util.ComputeServiceUtils.addMetadataAndParseTagsFromCommaDelimitedValue; import java.util.Map; import java.util.NoSuchElementException; @@ -111,7 +112,7 @@ public class ServerToNodeMetadata implements Function { builder.hostname(from.getName()); builder.location(new LocationBuilder().scope(LocationScope.HOST).id(from.getHostId()).description( from.getHostId()).parent(location.get()).build()); - builder.userMetadata(from.getMetadata()); + addMetadataAndParseTagsFromCommaDelimitedValue(builder, from.getMetadata()); builder.group(nodeNamingConvention.groupInUniqueNameOrNull(from.getName())); builder.imageId(from.getImageId() + ""); builder.operatingSystem(parseOperatingSystem(from)); diff --git a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/strategy/CloudServersComputeServiceAdapter.java b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/strategy/CloudServersComputeServiceAdapter.java index 4ff7c642f5..df7a956be2 100644 --- a/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/strategy/CloudServersComputeServiceAdapter.java +++ b/apis/cloudservers/src/main/java/org/jclouds/cloudservers/compute/strategy/CloudServersComputeServiceAdapter.java @@ -21,6 +21,7 @@ package org.jclouds.cloudservers.compute.strategy; import static com.google.common.base.Preconditions.checkNotNull; import static org.jclouds.cloudservers.options.CreateServerOptions.Builder.withMetadata; import static org.jclouds.cloudservers.options.ListOptions.Builder.withDetails; +import static org.jclouds.compute.util.ComputeServiceUtils.metadataAndTagsAsCommaDelimitedValue; import javax.inject.Inject; import javax.inject.Singleton; @@ -59,11 +60,13 @@ public class CloudServersComputeServiceAdapter implements ComputeServiceAdapter< Template template) { Server server = client .createServer(name, Integer.parseInt(template.getImage().getProviderId()), Integer.parseInt(template - .getHardware().getProviderId()), withMetadata(template.getOptions().getUserMetadata())); + .getHardware().getProviderId()), withMetadata(metadataAndTagsAsCommaDelimitedValue(template.getOptions()))); return new NodeAndInitialCredentials(server, server.getId() + "", LoginCredentials.builder().password( server.getAdminPass()).build()); } + + @Override public Iterable listHardwareProfiles() {