Method: HPE3PAR_API#add_iscsi_path_to_host

Defined in:
lib/puppet/util/hpe3par_api.rb

#add_iscsi_path_to_host(host_name, iscsi_names, debug = false) ⇒ Object



837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/puppet/util/hpe3par_api.rb', line 837

def add_iscsi_path_to_host(host_name, iscsi_names, debug = false)
  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
  begin
    cl.(@url.user, @url.password)
    mod_request = {'pathOperation' => Hpe3parSdk::HostEditOperation.const_get('ADD'),
                   'iSCSINames' => iscsi_names}
    cl.modify_host(host_name, mod_request)
    Puppet.info("iSCSI path #{iscsi_names} added to host #{host_name}")
  rescue Hpe3parSdk::HPE3PARException => ex
    Puppet.err(ex.message)
    raise ex
  ensure
    cl.logout
  end
end