Method: HPE3PAR_API#remove_fc_path_from_host

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

#remove_fc_path_from_host(host_name, fc_wwns, force_path_removal, debug = false) ⇒ Object



820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
# File 'lib/puppet/util/hpe3par_api.rb', line 820

def remove_fc_path_from_host(host_name, fc_wwns, 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'),
                   'FCWWNs' => fc_wwns,
                   'forcePathRemoval' => force_path_removal}
    cl.modify_host(host_name, mod_request)
    Puppet.info("FC path #{fc_wwns} removed from host #{host_name}")
  rescue Hpe3parSdk::HPE3PARException => ex
    Puppet.err(ex.message)
    raise ex
  ensure
    cl.logout
  end
end