jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Iván Lomba <notificati...@github.com>
Subject Re: [jclouds/jclouds] JCLOUDS-482: ArbitraryCpuRam base case (#984)
Date Mon, 08 Aug 2016 23:25:02 GMT
> +            .trimResults()
> +            .omitEmptyStrings()
> +            .withKeyValueSeparator('=')
> +            .split(hardwareSpec);
> +      if (!specValues.containsKey("ram") || !specValues.containsKey("cores")) {
> +         throw new IllegalArgumentException(String.format("Omitted keys on hardwareId:
%s. Please set number " +
> +               "of cores and ram amount.", hardwareId));
> +      }
> +      spec.ram = Integer.parseInt(specValues.get("ram"));
> +      spec.cores = Double.parseDouble(specValues.get("cores"));
> +      return spec;
> +   }
> +
> +   public static AutomaticHardwareIdSpec automaticHardwareIdSpecBuilder(double cores,
int ram) {
> +      AutomaticHardwareIdSpec spec = new AutomaticHardwareIdSpec();
> +      if (cores == 0 || ram == 0) {

Yes, It's only checking that the user has specified both values (they are primitives).

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/984/files/55c696c2ba870e202cfb8e42734e66bb31aab7b4#r73974500
Mime
View raw message