mirror of https://github.com/apache/jclouds.git
parent
788f75f937
commit
f82e94c337
|
@ -70,7 +70,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.yaml</groupId>
|
<groupId>org.yaml</groupId>
|
||||||
<artifactId>snakeyaml</artifactId>
|
<artifactId>snakeyaml</artifactId>
|
||||||
<version>1.32</version>
|
<version>2.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.auto.service</groupId>
|
<groupId>com.google.auto.service</groupId>
|
||||||
|
|
|
@ -25,6 +25,7 @@ import java.util.Map;
|
||||||
import org.jclouds.byon.Node;
|
import org.jclouds.byon.Node;
|
||||||
import org.jclouds.util.Closeables2;
|
import org.jclouds.util.Closeables2;
|
||||||
import org.yaml.snakeyaml.DumperOptions;
|
import org.yaml.snakeyaml.DumperOptions;
|
||||||
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.Constructor;
|
import org.yaml.snakeyaml.constructor.Constructor;
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ public class YamlNode {
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
try {
|
try {
|
||||||
in = byteSource.openStream();
|
in = byteSource.openStream();
|
||||||
return (YamlNode) new Yaml(new Constructor(YamlNode.class)).load(in);
|
return (YamlNode) new Yaml(new Constructor(YamlNode.class, new LoaderOptions())).load(in);
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
throw Throwables.propagate(ioe);
|
throw Throwables.propagate(ioe);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import javax.inject.Singleton;
|
||||||
|
|
||||||
import org.jclouds.byon.Node;
|
import org.jclouds.byon.Node;
|
||||||
import org.jclouds.byon.domain.YamlNode;
|
import org.jclouds.byon.domain.YamlNode;
|
||||||
|
import org.yaml.snakeyaml.LoaderOptions;
|
||||||
import org.yaml.snakeyaml.TypeDescription;
|
import org.yaml.snakeyaml.TypeDescription;
|
||||||
import org.yaml.snakeyaml.Yaml;
|
import org.yaml.snakeyaml.Yaml;
|
||||||
import org.yaml.snakeyaml.constructor.Constructor;
|
import org.yaml.snakeyaml.constructor.Constructor;
|
||||||
|
@ -80,7 +81,7 @@ public class NodesFromYamlStream implements Function<ByteSource, LoadingCache<St
|
||||||
@Override
|
@Override
|
||||||
public LoadingCache<String, Node> apply(ByteSource source) {
|
public LoadingCache<String, Node> apply(ByteSource source) {
|
||||||
|
|
||||||
Constructor constructor = new Constructor(Config.class);
|
Constructor constructor = new Constructor(Config.class, new LoaderOptions());
|
||||||
|
|
||||||
TypeDescription nodeDesc = new TypeDescription(YamlNode.class);
|
TypeDescription nodeDesc = new TypeDescription(YamlNode.class);
|
||||||
nodeDesc.putListPropertyType("tags", String.class);
|
nodeDesc.putListPropertyType("tags", String.class);
|
||||||
|
|
Loading…
Reference in New Issue