mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-18 02:42:54 +09:00
feature #1642: Add --dry option to onevm and onetemplate create
This commit is contained in:
1 parent
13391ab282
commit
0cee3d65c8
3 files changed
+16
-1
No files matched your search
@@ -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
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user