mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
(cherry picked from commit 59665e9f81132be4b3ee9fc64b3d4d81d20c0840)
This commit is contained in:
parent
e58dc4c521
commit
c4700778e8
@ -321,22 +321,22 @@ class EC2Driver
|
||||
if !ec2_value(ec2_info, 'USERDATA')
|
||||
xml = OpenNebula::XMLElement.new
|
||||
xml.initialize_xml(xml_text, 'VM')
|
||||
end
|
||||
|
||||
if xml.has_elements?('TEMPLATE/CONTEXT')
|
||||
# Since there is only 1 level ',' will not be added
|
||||
context_str = xml.template_like_str('TEMPLATE/CONTEXT')
|
||||
if xml.has_elements?('TEMPLATE/CONTEXT')
|
||||
# Since there is only 1 level ',' will not be added
|
||||
context_str = xml.template_like_str('TEMPLATE/CONTEXT')
|
||||
|
||||
if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'
|
||||
# TODO use OneGate library
|
||||
token_str = generate_onegate_token(xml)
|
||||
if token_str
|
||||
context_str << "\nONEGATE_TOKEN=\"#{token_str}\""
|
||||
if xml['TEMPLATE/CONTEXT/TOKEN'] == 'YES'
|
||||
# TODO use OneGate library
|
||||
token_str = generate_onegate_token(xml)
|
||||
if token_str
|
||||
context_str << "\nONEGATE_TOKEN=\"#{token_str}\""
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
userdata_key = EC2[:run][:args]["USERDATA"][:opt]
|
||||
opts[userdata_key] = Base64.encode64(context_str)
|
||||
userdata_key = EC2[:run][:args]["USERDATA"][:opt]
|
||||
opts[userdata_key] = Base64.encode64(context_str)
|
||||
end
|
||||
end
|
||||
|
||||
instances = @ec2.create_instances(opts)
|
||||
|
Loading…
x
Reference in New Issue
Block a user