mirror of https://github.com/apache/jclouds.git
more compatible delimiter as - doesn't work in rackspace
This commit is contained in:
parent
a2bbb0e611
commit
7d9bba750a
|
@ -193,7 +193,7 @@ public class ComputeServiceUtils {
|
||||||
Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
Builder<String, String> builder = ImmutableMap.<String, String> builder();
|
||||||
builder.putAll(options.getUserMetadata());
|
builder.putAll(options.getUserMetadata());
|
||||||
if (options.getTags().size() > 0)
|
if (options.getTags().size() > 0)
|
||||||
builder.put("jclouds.tags", Joiner.on(',').join(options.getTags()));
|
builder.put("jclouds_tags", Joiner.on(',').join(options.getTags()));
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,10 +202,10 @@ public class ComputeServiceUtils {
|
||||||
*/
|
*/
|
||||||
public static NodeMetadataBuilder addMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder,
|
public static NodeMetadataBuilder addMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder,
|
||||||
Map<String, String> map) {
|
Map<String, String> map) {
|
||||||
String tagString = map.get("jclouds.tags");
|
String tagString = map.get("jclouds_tags");
|
||||||
if (tagString != null)
|
if (tagString != null)
|
||||||
builder.tags(Splitter.on(',').split(tagString));
|
builder.tags(Splitter.on(',').split(tagString));
|
||||||
builder.userMetadata(filterKeys(map, not(equalTo("jclouds.tags"))));
|
builder.userMetadata(filterKeys(map, not(equalTo("jclouds_tags"))));
|
||||||
return builder;
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class ComputeServiceUtilsTest {
|
||||||
@Test
|
@Test
|
||||||
public void testMetadataAndTagsAsCommaDelimitedValue() {
|
public void testMetadataAndTagsAsCommaDelimitedValue() {
|
||||||
TemplateOptions options = TemplateOptions.Builder.tags(ImmutableSet.of("tag")).userMetadata(ImmutableMap.<String, String>of("foo", "bar"));
|
TemplateOptions options = TemplateOptions.Builder.tags(ImmutableSet.of("tag")).userMetadata(ImmutableMap.<String, String>of("foo", "bar"));
|
||||||
assertEquals(metadataAndTagsAsCommaDelimitedValue(options), ImmutableMap.<String, String>of("foo", "bar", "jclouds.tags", "tag"));
|
assertEquals(metadataAndTagsAsCommaDelimitedValue(options), ImmutableMap.<String, String>of("foo", "bar", "jclouds_tags", "tag"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue