Method: HPE3PAR_API#remove_hosts_from_host_set

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

#remove_hosts_from_host_set(host_set_name, setmembers, debug = false) ⇒ Object



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# File 'lib/puppet/util/hpe3par_api.rb', line 125

def remove_hosts_from_host_set(host_set_name, setmembers, debug = false)
  cl = Hpe3parSdk::Client.new(@rest_url, debug: debug)
  begin
    current_set_members = get_host_set(host_set_name).setmembers

    if current_set_members != nil
      common_set_members = current_set_members & setmembers
    end

    if !common_set_members.nil? and common_set_members.any?
      cl.(@url.user, @url.password)
      cl.remove_hosts_from_host_set(host_set_name, common_set_members)
    end
  ensure
    cl.logout
  end
end