feature #1642: add support for --context in vm creation

This commit is contained in:
Javi Fontan committed 2012-11-15 16:14:30 +01:00
1 parent c3972b4f9a
commit ad9e86dca5
1 file changed
+9 -1
+9 -1
View File
@@ -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