Method: HPE3PAR_API#remove_iscsi_path_from_host

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

#remove_iscsi_path_from_host(host_name, iscsi_names, force_path_removal, debug = false) ⇒ Object



853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
# File 'lib/puppet/util/hpe3par_api.rb', line 853

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