1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Feature #1224: Make the snapshot name optional in the CLI

This commit is contained in:
Carlos Martín 2013-02-20 17:37:23 +01:00
parent ddcc7dc655
commit 75a6692761
2 changed files with 3 additions and 2 deletions

View File

@ -627,7 +627,7 @@ cmd=CommandParser::CmdParser.new(ARGV) do
Creates a new VM snapshot
EOT
command :"snapshot-create", snapshot_create_desc, :vmid, :name do
command :"snapshot-create", snapshot_create_desc, :vmid, [:name, nil] do
helper.perform_action(args[0],options,"snapshot created") do |o|
o.snapshot_create(args[1])
end

View File

@ -417,7 +417,8 @@ module OpenNebula
#
# @return [nil, OpenNebula::Error] nil in case of success, Error
# otherwise
def snapshot_create(name)
def snapshot_create(name="")
name ||= ""
return call(VM_METHODS[:snapshotcreate], @pe_id, name)
end