mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-18 10:53:13 +09:00
feature #1642: add support for --context in vm creation
This commit is contained in:
1 parent
c3972b4f9a
commit
ad9e86dca5
1 file changed
+9
-1
@@ -158,6 +158,12 @@ EOT
|
||||
:large => '--net_context',
|
||||
:description => 'Add network contextualization parameters'
|
||||
},
|
||||
{
|
||||
:name => 'context',
|
||||
:large => '--context line1,line2,line3',
|
||||
:format => Array,
|
||||
:description => 'Lines to add to the context section'
|
||||
},
|
||||
{
|
||||
:name => 'dry',
|
||||
:large => '--dry',
|
||||
@@ -599,7 +605,7 @@ EOT
|
||||
end
|
||||
|
||||
def self.create_context(options)
|
||||
if !(options.keys & [:ssh, :net_context]).empty?
|
||||
if !(options.keys & [:ssh, :net_context, :context]).empty?
|
||||
lines=[]
|
||||
|
||||
if options[:ssh]
|
||||
@@ -635,6 +641,8 @@ EOT
|
||||
end
|
||||
end
|
||||
|
||||
lines+=options[:context]
|
||||
|
||||
if !lines.empty?
|
||||
"CONTEXT=[\n"<<lines.map{|l| " "<<l }.join(",\n")<<"\n]\n"
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user