Username variable in CONTEXT
|Assignee:||Ruben S. Montero||% Done:|
|Category:||Core & System|
|Target version:||Release 3.0|
Reported by Olivier Sallou <firstname.lastname@example.org> on the users mailing list
is there a variable or a way to get the username (open nebula user id) of the person creating a new VM ?
I'd like to know the username to automatically add his public key, so using a generic xml file.
feature #513: More robust XML generation for empty attributes. This may only happen after parsing context attributes
feature #513: UID, TEMPLATE can be used in context. Also IMAGE template attributes can be referred
feature #513: Imrpved parser for attributes, double qoutes are not needed for simple values
#3 Updated by jordan pittier over 9 years ago
Here is a small patch that will provide context.sh with the UserID of the person who created the VM :
Edit opennebula-2.2/src/vm/VirtualMachine.cc line 441 add :
ostringstream oss; oss << uid; context_parsed->replace("USERID", oss.str());
Now context.sh will contain a line like this (assuming UserID = 12, this is an example :p) :