mirror of https://github.com/apache/jclouds.git
URI is used to calculate the server image and hardware
test fixes
This commit is contained in:
parent
3ce5c9fe2c
commit
cf82aab594
|
@ -76,7 +76,7 @@ public class ServerToNodeMetadata implements Function<Server, NodeMetadata> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Image input) {
|
||||
return input.getProviderId().equals(instance.getImageRef() + "");
|
||||
return input.getUri().toString().equals(instance.getImageRef() + "");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class ServerToNodeMetadata implements Function<Server, NodeMetadata> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Hardware input) {
|
||||
return input.getProviderId().equals(instance.getFlavorRef() + "");
|
||||
return input.getUri().toString().equals(instance.getFlavorRef() + "");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ public class _NovaClient {
|
|||
e.printStackTrace();
|
||||
}*/
|
||||
|
||||
//cs.destroyNode("64");
|
||||
|
||||
context.close();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package org.jclouds.openstack.nova.functions;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Key;
|
||||
|
@ -27,6 +28,7 @@ import org.jclouds.http.HttpResponse;
|
|||
import org.jclouds.http.functions.UnwrapOnlyJsonValue;
|
||||
import org.jclouds.io.Payloads;
|
||||
import org.jclouds.json.config.GsonModule;
|
||||
import org.jclouds.openstack.nova.domain.Address;
|
||||
import org.jclouds.openstack.nova.domain.Addresses;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
|
@ -53,9 +55,13 @@ public class ParseAddressesFromJsonResponseTest {
|
|||
}));
|
||||
Addresses response = parser.apply(new HttpResponse(200, "ok", Payloads.newInputStreamPayload(is)));
|
||||
|
||||
List<String> publicAddresses = ImmutableList.of("67.23.10.132", "::babe:67.23.10.132", "67.23.10.131", "::babe:4317:0A83");
|
||||
List<Address> publicAddresses = ImmutableList.copyOf(
|
||||
Iterables.transform(ImmutableList.of("67.23.10.132", "::babe:67.23.10.132", "67.23.10.131", "::babe:4317:0A83"),
|
||||
Address.newString2AddressFunction()));
|
||||
|
||||
List<String> privateAddresses = ImmutableList.of("10.176.42.16", "::babe:10.176.42.16");
|
||||
List<Address> privateAddresses = ImmutableList.copyOf(
|
||||
Iterables.transform(ImmutableList.of("10.176.42.16", "::babe:10.176.42.16"),
|
||||
Address.newString2AddressFunction()));
|
||||
|
||||
assertEquals(response.getPublicAddresses(), publicAddresses);
|
||||
assertEquals(response.getPrivateAddresses(), privateAddresses);
|
||||
|
|
|
@ -1,23 +1,15 @@
|
|||
{
|
||||
"addresses" : {
|
||||
"values" : [
|
||||
{
|
||||
"id" : "public",
|
||||
"values" : [
|
||||
{"version" : 4, "addr" : "67.23.10.132"},
|
||||
{"version" : 6, "addr" : "::babe:67.23.10.132"},
|
||||
{"version" : 4, "addr" : "67.23.10.131"},
|
||||
{"version" : 6, "addr" : "::babe:4317:0A83"}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id" : "private",
|
||||
"values" : [
|
||||
{"version" : 4, "addr" : "10.176.42.16"},
|
||||
{"version" : 6, "addr" : "::babe:10.176.42.16"}
|
||||
]
|
||||
}
|
||||
"public" : [
|
||||
{"version" : 4, "addr" : "67.23.10.132"},
|
||||
{"version" : 6, "addr" : "::babe:67.23.10.132"},
|
||||
{"version" : 4, "addr" : "67.23.10.131"},
|
||||
{"version" : 6, "addr" : "::babe:4317:0A83"}
|
||||
],
|
||||
"private" : [
|
||||
{"version" : 4, "addr" : "10.176.42.16"},
|
||||
{"version" : 6, "addr" : "::babe:10.176.42.16"}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue