mirror of https://github.com/apache/jclouds.git
Issue 327: fixed terremark tag pattern and disk parsing
This commit is contained in:
parent
3363f62b83
commit
5b215533f1
|
@ -107,8 +107,7 @@ public class BaseComputeService implements ComputeService {
|
|||
ListNodesStrategy listNodesStrategy, GetNodeMetadataStrategy getNodeMetadataStrategy,
|
||||
RunNodesAndAddToSetStrategy runNodesAndAddToSetStrategy, RebootNodeStrategy rebootNodeStrategy,
|
||||
DestroyNodeStrategy destroyNodeStrategy, Provider<TemplateBuilder> templateBuilderProvider,
|
||||
Provider<TemplateOptions> templateOptionsProvider,
|
||||
@Named("NODE_RUNNING") Predicate<NodeMetadata> nodeRunning,
|
||||
Provider<TemplateOptions> templateOptionsProvider, @Named("NODE_RUNNING") Predicate<NodeMetadata> nodeRunning,
|
||||
@Named("NODE_TERMINATED") Predicate<NodeMetadata> nodeTerminated, ComputeUtils utils,
|
||||
@Named(Constants.PROPERTY_USER_THREADS) ExecutorService executor) {
|
||||
this.context = checkNotNull(context, "context");
|
||||
|
|
|
@ -255,8 +255,9 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
|
||||
assertLocationSameOrChild(node1.getLocation(), template.getLocation());
|
||||
assertLocationSameOrChild(node2.getLocation(), template.getLocation());
|
||||
|
||||
if (node1.getImage() != null)
|
||||
assertEquals(node1.getImage(), template.getImage());
|
||||
if (node2.getImage() != null)
|
||||
assertEquals(node2.getImage(), template.getImage());
|
||||
|
||||
}
|
||||
|
@ -337,9 +338,8 @@ public abstract class BaseComputeServiceLiveTest {
|
|||
.append("echo \"name=jdkrepository\" >> /etc/yum.repos.d/CentOS-Base.repo\n")
|
||||
.append(
|
||||
"echo \"baseurl=http://ec2-us-east-mirror.rightscale.com/epel/5/i386/\" >> /etc/yum.repos.d/CentOS-Base.repo\n")
|
||||
.append("echo \"enabled=1\" >> /etc/yum.repos.d/CentOS-Base.repo\n")
|
||||
.append("yum --nogpgcheck -y install java-1.6.0-openjdk\n")
|
||||
.append(
|
||||
.append("echo \"enabled=1\" >> /etc/yum.repos.d/CentOS-Base.repo\n").append(
|
||||
"yum --nogpgcheck -y install java-1.6.0-openjdk\n").append(
|
||||
"echo \"export PATH=\\\"/usr/lib/jvm/jre-1.6.0-openjdk/bin/:\\$PATH\\\"\" >> /root/.bashrc\n")
|
||||
.toString();
|
||||
default:
|
||||
|
|
|
@ -60,7 +60,7 @@ public class GetExtra implements Function<VApp, Map<String, String>> {
|
|||
.getVirtualQuantity()
|
||||
+ "");
|
||||
for (ResourceAllocation disk : filter(vApp.getResourceAllocations(), resourceType(ResourceType.DISK_DRIVE))) {
|
||||
extra.put(String.format("disk_drive/%s/kb", disk.getId()), disk.getVirtualQuantity() + "");
|
||||
extra.put(String.format("disk_drive/%s/kb", disk.getAddressOnParent()), disk.getVirtualQuantity() + "");
|
||||
}
|
||||
|
||||
for (Entry<String, String> net : vApp.getNetworkToAddresses().entries()) {
|
||||
|
|
|
@ -67,7 +67,7 @@ public class VCloudGetNodeMetadata {
|
|||
protected final GetExtra getExtra;
|
||||
protected final Map<VAppStatus, NodeState> vAppStatusToNodeState;
|
||||
|
||||
public static final Pattern TAG_PATTERN_WITHOUT_TEMPLATE = Pattern.compile("([^-]+)-[0-9]+");
|
||||
public static final Pattern TAG_PATTERN_WITHOUT_TEMPLATE = Pattern.compile("([^-]+)-[0-9a-f]+");
|
||||
|
||||
@Inject
|
||||
VCloudGetNodeMetadata(VCloudClient client, VCloudComputeClient computeClient,
|
||||
|
|
|
@ -69,7 +69,7 @@ public class VCloudComputeServiceLiveTest extends BaseComputeServiceLiveTest {
|
|||
assertEquals(node.getType(), ComputeType.NODE);
|
||||
NodeMetadata allData = client.getNodeMetadata(node.getId());
|
||||
assert allData.getExtra().get("processor/count") != null : allData.getExtra();
|
||||
assert allData.getExtra().get("disk_drive/1/kb") != null : allData.getExtra();
|
||||
assert allData.getExtra().get("disk_drive/0/kb") != null : allData.getExtra();
|
||||
assert allData.getExtra().get("memory/mb") != null : allData.getExtra();
|
||||
System.out.println(allData.getExtra());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue