1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-26 10:03:37 +03:00

B #5559: Fix VM encrypted attributes (#1543)

(cherry picked from commit 52a6aa6c2020c72bd9bcee6b716cc0423f0a756a)
This commit is contained in:
Pavel Czerný 2021-11-25 09:12:11 +01:00 committed by Ruben S. Montero
parent 6a9abff5b3
commit 3a547b3716
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87
3 changed files with 10 additions and 4 deletions

View File

@ -92,8 +92,6 @@ int VirtualMachine::generate_context(string &files, int &disk_id,
return -1;
}
decrypt();
VectorAttribute * context = obj_template->get("CONTEXT");
if ( context == 0 )
@ -196,6 +194,8 @@ int VirtualMachine::generate_context(string &files, int &disk_id,
files += (" " + history->token_file);
}
decrypt();
const map<string, string>& values = context->value();
file << "# Context variables generated by OpenNebula\n";
@ -219,6 +219,8 @@ int VirtualMachine::generate_context(string &files, int &disk_id,
context->vector_value("DISK_ID", disk_id);
encrypt();
return 1;
}
@ -348,14 +350,14 @@ int VirtualMachine::generate_network_context(VectorAttribute* context,
continue;
}
else if (get_nic(nic_id)->is_alias()) // If nic was detached and current is alias
{
{
int parent_id;
vatts[i]->vector_value("PARENT_ID", parent_id);
// If parent was detached clear alis
if (get_nic(parent_id)->vector_value("ATTACH") == "YES")
{
{
int alias_id;
vatts[i]->vector_value("ALIAS_ID", alias_id);

View File

@ -62,6 +62,8 @@ int VMTemplatePool::allocate (
goto error_duplicated;
}
vm_template->encrypt();
// ------------------------------------------------------------------------
// Insert the Object in the pool
// ------------------------------------------------------------------------

View File

@ -85,6 +85,8 @@ int VNTemplate::insert(SqlDB *db, string& error_str)
return -1;
}
encrypt();
// ------------------------------------------------------------------------
// Insert the Template
// ------------------------------------------------------------------------