Feature #513
Username variable in CONTEXT
Status: | Closed | Start date: | 03/04/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Ruben S. Montero | % Done: | 0% | |
Category: | Core & System | |||
Target version: | Release 3.0 | |||
Resolution: | fixed | Pull request: |
Description
Reported by Olivier Sallou <olivier.sallou@irisa.fr> on the users mailing list
--
Hi,
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.
Associated revisions
feature #513: Moved SSL utils to a common Helper Class
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
feature #513: Hooks can now use the ID or full template as arguments
feature #513: Updated oned.conf file
History
#1 Updated by Ruben S. Montero over 10 years ago
- Target version changed from 23 to Release 3.0
#2 Updated by Ruben S. Montero over 10 years ago
- Tracker changed from Request to Feature
#3 Updated by jordan pittier about 10 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) :
USERID="12"
#4 Updated by Ruben S. Montero about 10 years ago
- Status changed from New to Closed
- Resolution set to fixed
- $UID in context
- $IMAGE attributes (equivalent to $NETWORK)
- $TEMPLATE to get the full VM info in xml and base64 encoded