Skip to content

Commit a079102

Browse files
committed
Get backup data if not found
Bare-metal types only have VCpuInfo/DefaultVCpus
1 parent 8f049c1 commit a079102

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

citc/aws.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ def get_types_info(client):
8686
s: {
8787
"memory": d["MemoryInfo"]["SizeInMiB"]
8888
- int(math.pow(d["MemoryInfo"]["SizeInMiB"], 0.7) * 0.9 + 500),
89-
"cores_per_socket": d["VCpuInfo"]["DefaultCores"],
90-
"threads_per_core": d["VCpuInfo"]["DefaultThreadsPerCore"],
89+
"cores_per_socket": d["VCpuInfo"].get("DefaultCores", d["VCpuInfo"]["DefaultVCpus"]),
90+
"threads_per_core": d["VCpuInfo"].get("DefaultThreadsPerCore", 1),
9191
"arch": d["ProcessorInfo"]["SupportedArchitectures"][0],
9292
}
9393
for s, d in instances.items()

0 commit comments

Comments
 (0)