Method: HPE3PAR_API#add_fc_path_to_host

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

#add_fc_path_to_host(host_name, fc_wwns, debug = false) ⇒ Object



804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
# File 'lib/puppet/util/hpe3par_api.rb', line 804

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