~blr/charms/precise/squid-forwardproxy/port-fix

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: Kit Randel
  • Date: 2015-08-14 00:45:46 UTC
  • Revision ID: kit.randel@canonical.com-20150814004546-g8sgw664hm84gto2
Pluralise auth_param.

Show diffs side-by-side

added added

removed removed

Lines of Context:
275
275
            }
276
276
        acls_and_access.append((acls, access))
277
277
 
278
 
    auth_param = []
279
 
    if config_data['auth_param']:
280
 
        auth_param_data = yaml.load(config_data['auth_param'])
281
 
        for scheme in auth_param_data:
 
278
    auth_params = []
 
279
    if config_data['auth_params']:
 
280
        auth_params_data = yaml.load(config_data['auth_params'])
 
281
        for scheme in auth_params_data:
282
282
            if 'children' in scheme and isinstance(scheme['children'], dict):
283
283
                children = '%d' % scheme['children']['number']
284
284
                for key, val in scheme['children'].iteritems():
285
285
                    if key != 'number':
286
286
                        children += ' %s=%s' % (key, val)
287
287
                scheme['children'] = children
288
 
            auth_param.append(scheme)
 
288
            auth_params.append(scheme)
289
289
 
290
290
    config_data['cache_l1'] = int(math.ceil(math.sqrt(
291
291
        int(config_data['cache_size_mb']) * 1024 / (16 *
297
297
            'config': config_data,
298
298
            'relations': relations,
299
299
            'refresh_patterns': refresh_patterns,
300
 
            'auth_param': auth_param,
 
300
            'auth_params': auth_params,
301
301
            'acls_and_access': acls_and_access,
302
302
        }
303
303
        squid3_config.write(utils.render_template('main_config.template',