Class: Chef::Knife::SceVolumeAttach
- Inherits:
-
Chef::Knife
- Object
- Chef::Knife
- Chef::Knife::SceVolumeAttach
- Includes:
- SceBase
- Defined in:
- lib/chef/knife/sce_volume_attach.rb
Instance Method Summary collapse
Methods included from SceBase
#connection, #connection_storage, #datacenter_id, included, #locate_config_value, #msg_pair, #validate!
Instance Method Details
#run ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/chef/knife/sce_volume_attach.rb', line 28 def run $stdout.sync = true validate! (1..@name_args.length-1).each do |idx| puts "Attaching volume #{@name_args[idx]} to #{name_args[0]}" begin res = connection.modify_instance(@name_args[0], { "type" => "attach", "storageID" => @name_args[idx] }) rescue Exception => e ui.error("There was an error while attaching volume #{@name_args[idx]}. Error is #{e.to_s}") end end end |