Skip to content

Commit

Permalink
Handle alternative spelling of machine memory size for Azure VMs
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Talbot <[email protected]>
  • Loading branch information
adamrtalbot committed Jul 1, 2024
1 parent fe880a6 commit 10194cc
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ class AzBatchService implements Closeable {

protected Double computeScore(int cpus, MemoryUnit mem, Map entry) {
def vmCores = entry.numberOfCores as int
double vmMemGb = (entry.memoryInMb as int) /1024
// Azure spells it with two different spellings
int entryInMb = (entry.memoryInMB ?: entry.memoryInMb) as int
double vmMemGb = entryInMb/1024

println "VM: ${entry.name} cpus: $vmCores mem: $vmMemGb"

if( cpus > vmCores ) {
return null
Expand Down

0 comments on commit 10194cc

Please sign in to comment.