Method: Puppet::Provider::AixObject.list_all

Defined in:
lib/puppet/provider/aixobject.rb

.list_allObject

List all elements of given type. It works for colon separated commands and list commands. It returns a list of names.



252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/puppet/provider/aixobject.rb', line 252

def self.list_all
  names = []
  begin
    output = execute([self.command(:list), 'ALL'])

    output = output.split("\n").select{ |line| line != /^#/ }

    output.each do |line|
      name = line.split(/[ :]/)[0]
      names << name if not name.empty?
    end
  rescue Puppet::ExecutionFailure => detail
    # Print error if needed
    Puppet.debug "aix.list_all(): Could not get all resources of type #{@resource.class.name}: #{detail}"
  end
  names
end