feature #1642: Add --dry option to onevm and onetemplate create

This commit is contained in:
Javi Fontan committed 2012-11-07 15:21:04 +01:00
1 parent 13391ab282
commit 0cee3d65c8
3 files changed
+16 -1

No files matched your search

+5
View File
@@ -132,6 +132,11 @@ EOT
:large => '--raw string',
:description => 'Raw string to add to the template. Not to be confused with the RAW attribute',
:format => String
},
{
:name => 'dry',
:large => '--dry',
:description => 'Just print the template'
}
]
+6 -1
View File
@@ -121,7 +121,12 @@ cmd=CommandParser::CmdParser.new(ARGV) do
template = res.last
end
tmpl.allocate(template)
if options[:dry]
puts template
exit 0
else
tmpl.allocate(template)
end
rescue => e
STDERR.puts e.messsage
exit -1
+5
View File
@@ -139,6 +139,11 @@ cmd=CommandParser::CmdParser.new(ARGV) do
template = res.last
end
if options[:dry]
puts template
exit 0
end
rescue Exception => e
STDERR.puts "Error reading template."
next -1