lib/puppet/type/macgroup.rb
# Resolve a group name to uuid in OpenDirectory
# - given a valid name value, return the GeneratedUID for the group
Resolve a group name to uuid in OpenDirectory
given a valid name value, return the GeneratedUID for the group
Resolve a group name to uuid in OpenDirectory given a valid name value return the GeneratedUID for the group
def group_to_uuid(name)
      result = ::ManagedMacCommon::dscl_find_by(:groups, 'name', name)
      unless result.respond_to? :first
        raise Puppet::Error,
           "An unknown error occured while searching: #{result}"
      end
      if result.empty?
        Puppet::Util::Warnings.warnonce(
          "Macgroup: Group not found: \'#{name}\'")
        return nil
      end
      cmd_args = [::ManagedMacCommon::DSCL, ::ManagedMacCommon::SEARCH_NODE,
        'read', "/Groups/\'#{name}\'", 'GeneratedUID']
      `#{cmd_args.join(' ')}`.chomp.split.last.strip
    end
def group_to_uuid ( name ) result = :: ManagedMacCommon :: dscl_find_by ( :groups , 'name' , name ) unless result . respond_to? :first raise Puppet :: Error , "An unknown error occured while searching: #{result}" end if result . empty? Puppet :: Util :: Warnings . warnonce ( "Macgroup: Group not found: \'#{name}\'" ) return nil end cmd_args = [ :: ManagedMacCommon :: DSCL , :: ManagedMacCommon :: SEARCH_NODE , 'read' , "/Groups/\'#{name}\'" , 'GeneratedUID' ] ` #{ cmd_args . join ( ' ' ) } ` . chomp . split . last . strip end
Resolve a group name to uuid in OpenDirectory
 given a valid name value, return the GeneratedUID for the group
Resolve a group name to uuid in OpenDirectory given a valid name value return the GeneratedUID for the group
name