lib/puppet/provider/macauthdb/default.rb
def prepare_rule_data(data)
    data['type']  = 2
    data['flags'] = self.class.pack_flags(data)
    data['class'] = self.class.convert_class_to_int(data['class']) || 1

    defaults = {
      'flags'    => 0,
      'version'  => 0,
      'created'  => timestamp,
      'modified' => timestamp,
    }

    class_defaults = [
      defaults.merge(Hash['timeout', 2147483647, 'flags', 9, 'tries', 10000]),
      defaults,
      defaults,
      defaults.merge(Hash['flags', 1, 'tries', 10000]),
      defaults.merge(Hash['kofn', 1, 'flags', 0 ]),
    ]

    data       = class_defaults[data['class']].merge(data)
    rule       = data.delete('rule')
    mechanisms = data.delete('mechanisms')

    [data, rule, mechanisms]
  end
# Prepares the data processing by #sql_create_rule
Prepares the data processing by #sql_create_rule
Prepares the data processing by #sql_create_rule
def prepare_rule_data(data)
    data['type']  = 2
    data['flags'] = self.class.pack_flags(data)
    data['class'] = self.class.convert_class_to_int(data['class']) || 1
    defaults = {
      'flags'    => 0,
      'version'  => 0,
      'created'  => timestamp,
      'modified' => timestamp,
    }
    class_defaults = [
      defaults.merge(Hash['timeout', 2147483647, 'flags', 9, 'tries', 10000]),
      defaults,
      defaults,
      defaults.merge(Hash['flags', 1, 'tries', 10000]),
      defaults.merge(Hash['kofn', 1, 'flags', 0 ]),
    ]
    data       = class_defaults[data['class']].merge(data)
    rule       = data.delete('rule')
    mechanisms = data.delete('mechanisms')
    [data, rule, mechanisms]
  end
def prepare_rule_data ( data ) data [ 'type' ] = 2 data [ 'flags' ] = self . class . pack_flags ( data ) data [ 'class' ] = self . class . convert_class_to_int ( data [ 'class' ] ) || 1 defaults = { 'flags' => 0 , 'version' => 0 , 'created' => timestamp , 'modified' => timestamp , } class_defaults = [ defaults . merge ( Hash [ 'timeout' , 2147483647 , 'flags' , 9 , 'tries' , 10000 ] ) , defaults , defaults , defaults . merge ( Hash [ 'flags' , 1 , 'tries' , 10000 ] ) , defaults . merge ( Hash [ 'kofn' , 1 , 'flags' , 0 ] ) , ] data = class_defaults [ data [ 'class' ] ] . merge ( data ) rule = data . delete ( 'rule' ) mechanisms = data . delete ( 'mechanisms' ) [ data , rule , mechanisms ] end
Prepares the data processing by #sql_create_rule
Prepares the data processing by #sql_create_rule
data