1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-29 18:50:08 +03:00

F #6275: Remove TEMPLATE from VM information

{
  "CAPACITY": {
    "CPU": 1.5,
    "DISK_SIZE": 1024,
    "MEMORY": 131072
  },
  "HOST_IDS": [
    3,
    4,
    5
  ],
  "ID": 33,
  "STATE": "PENDING",
  "USER_TEMPLATE": {}
}

co-authored-by: Pavel Czerny <pczerny@opennebula.io>
This commit is contained in:
Ruben S. Montero 2023-08-29 17:43:27 +02:00
parent dca50b2bb9
commit 40d62686ee
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -734,17 +734,9 @@ void VirtualMachineXML::to_json(json &vm_json)
vm_json["HOST_IDS"] = hosts_json;
// -------------------------------------------------------------------------
// Add Template and UserTemplate
// Add UserTemplate
// -------------------------------------------------------------------------
string templ_str, user_templ_str;
vm_template->to_json(templ_str);
templ_str = "{" + templ_str + "}";
auto templ_json = json::parse(templ_str);
vm_json["TEMPLATE"] = templ_json["TEMPLATE"];
string user_templ_str;
user_template->to_json(user_templ_str);