Fix to ensure that tacacs servers are ordered (reverse) by priority in pam.d's config. (#3322)
Present: Servers are listed in the same order as in redis-db Fix: Save the sort o/p, hence use sorted list to write into pam.d's conf. As well convert priority to integer for use by sort.
This commit is contained in:
parent
7b0389d8a3
commit
fcdf62f5f6
@ -114,7 +114,7 @@ class AaaCfg(object):
|
||||
server['ip'] = addr
|
||||
server.update(self.tacplus_servers[addr])
|
||||
servers_conf.append(server)
|
||||
sorted(servers_conf, key=lambda t: t['priority'], reverse=True)
|
||||
servers_conf = sorted(servers_conf, key=lambda t: int(t['priority']), reverse=True)
|
||||
|
||||
template_file = os.path.abspath(PAM_AUTH_CONF_TEMPLATE)
|
||||
env = jinja2.Environment(loader=jinja2.FileSystemLoader('/'), trim_blocks=True)
|
||||
|
Reference in New Issue
Block a user