From d585ace712a59949bae2d38cf6564cc1ef2924f0 Mon Sep 17 00:00:00 2001 From: Andrew Bayer Date: Sun, 22 Jul 2012 12:23:22 -0700 Subject: [PATCH] Cloudstack VirtualMachines can have negative cpuUsed values for some reason --- .../main/java/org/jclouds/cloudstack/domain/VirtualMachine.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/VirtualMachine.java b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/VirtualMachine.java index 675114c577..5e5fee9a57 100644 --- a/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/VirtualMachine.java +++ b/apis/cloudstack/src/main/java/org/jclouds/cloudstack/domain/VirtualMachine.java @@ -588,7 +588,7 @@ public class VirtualMachine { @Nullable VirtualMachine.State state, @Nullable String templateDisplayText, @Nullable String templateId, @Nullable String templateName, @Nullable String zoneId, @Nullable String zoneName, @Nullable Set nics, @Nullable String hypervisor, @Nullable Set securityGroups) { - Preconditions.checkArgument(Strings.isNullOrEmpty(cpuUsed) || cpuUsed.matches("^[0-9\\.]+%$"), "cpuUsed value should be a decimal number followed by %"); + Preconditions.checkArgument(Strings.isNullOrEmpty(cpuUsed) || cpuUsed.matches("^[0-9\\.\\-]+%$"), "cpuUsed value should be a decimal number followed by %"); this.id = checkNotNull(id, "id"); this.account = account; this.cpuCount = cpuCount;