mirror of
https://github.com/apache/jclouds.git
synced 2025-02-16 15:08:28 +00:00
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
|
@Override
|
||||||
public boolean apply(Image input) {
|
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
|
@Override
|
||||||
public boolean apply(Hardware input) {
|
public boolean apply(Hardware input) {
|
||||||
return input.getProviderId().equals(instance.getFlavorRef() + "");
|
return input.getUri().toString().equals(instance.getFlavorRef() + "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,6 +47,8 @@ public class _NovaClient {
|
|||||||
} catch (RunNodesException e) {
|
} catch (RunNodesException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
//cs.destroyNode("64");
|
||||||
|
|
||||||
context.close();
|
context.close();
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
package org.jclouds.openstack.nova.functions;
|
package org.jclouds.openstack.nova.functions;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.google.common.collect.Iterables;
|
||||||
import com.google.inject.Guice;
|
import com.google.inject.Guice;
|
||||||
import com.google.inject.Injector;
|
import com.google.inject.Injector;
|
||||||
import com.google.inject.Key;
|
import com.google.inject.Key;
|
||||||
@ -27,6 +28,7 @@ import org.jclouds.http.HttpResponse;
|
|||||||
import org.jclouds.http.functions.UnwrapOnlyJsonValue;
|
import org.jclouds.http.functions.UnwrapOnlyJsonValue;
|
||||||
import org.jclouds.io.Payloads;
|
import org.jclouds.io.Payloads;
|
||||||
import org.jclouds.json.config.GsonModule;
|
import org.jclouds.json.config.GsonModule;
|
||||||
|
import org.jclouds.openstack.nova.domain.Address;
|
||||||
import org.jclouds.openstack.nova.domain.Addresses;
|
import org.jclouds.openstack.nova.domain.Addresses;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
@ -53,9 +55,13 @@ public class ParseAddressesFromJsonResponseTest {
|
|||||||
}));
|
}));
|
||||||
Addresses response = parser.apply(new HttpResponse(200, "ok", Payloads.newInputStreamPayload(is)));
|
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.getPublicAddresses(), publicAddresses);
|
||||||
assertEquals(response.getPrivateAddresses(), privateAddresses);
|
assertEquals(response.getPrivateAddresses(), privateAddresses);
|
||||||
|
@ -1,23 +1,15 @@
|
|||||||
{
|
{
|
||||||
"addresses" : {
|
"addresses" : {
|
||||||
"values" : [
|
"public" : [
|
||||||
{
|
{"version" : 4, "addr" : "67.23.10.132"},
|
||||||
"id" : "public",
|
{"version" : 6, "addr" : "::babe:67.23.10.132"},
|
||||||
"values" : [
|
{"version" : 4, "addr" : "67.23.10.131"},
|
||||||
{"version" : 4, "addr" : "67.23.10.132"},
|
{"version" : 6, "addr" : "::babe:4317:0A83"}
|
||||||
{"version" : 6, "addr" : "::babe:67.23.10.132"},
|
],
|
||||||
{"version" : 4, "addr" : "67.23.10.131"},
|
"private" : [
|
||||||
{"version" : 6, "addr" : "::babe:4317:0A83"}
|
{"version" : 4, "addr" : "10.176.42.16"},
|
||||||
]
|
{"version" : 6, "addr" : "::babe:10.176.42.16"}
|
||||||
},
|
|
||||||
{
|
|
||||||
"id" : "private",
|
|
||||||
"values" : [
|
|
||||||
{"version" : 4, "addr" : "10.176.42.16"},
|
|
||||||
{"version" : 6, "addr" : "::babe:10.176.42.16"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user