Sha256: 4737fddccd456aee427776a455d4e07239a15f8a0b3404f183aa58560c270de4

Contents?: true

Size: 497 Bytes

Versions: 8

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

class UserAttr
  def self.get_attributes_by_name(name)
    attributes = nil

    File.readlines('/etc/user_attr').each do |line|
      next if line =~ /^#/

      token = line.split(':')

      if token[0] == name
        attributes = { :name => name }
        token[4].split(';').each do |attr|
          key_value = attr.split('=')
          attributes[key_value[0].intern] = key_value[1].strip
        end
        break
      end
    end
    attributes
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-8.5.1 lib/puppet/util/user_attr.rb
puppet-8.5.1-x86-mingw32 lib/puppet/util/user_attr.rb
puppet-8.5.1-x64-mingw32 lib/puppet/util/user_attr.rb
puppet-8.5.1-universal-darwin lib/puppet/util/user_attr.rb
puppet-8.5.0 lib/puppet/util/user_attr.rb
puppet-8.5.0-x86-mingw32 lib/puppet/util/user_attr.rb
puppet-8.5.0-x64-mingw32 lib/puppet/util/user_attr.rb
puppet-8.5.0-universal-darwin lib/puppet/util/user_attr.rb